GGTS IDE complains unable to resolve plugin classes but the application compiles and runs without issues - grails

GGTS IDE complains unable to resolve plugin classes when importing but the application compiles and runs without issues. Could someone please help resolve this error
e.g. : When using grails jms plugin and defining the Queue annotation
import grails.plugin.jms.Queue
#Queue(name='msg.new')
The error thrown by IDE is Groovy:
unable to resolve class grails.plugin.jms.Queue

Related

Using a Grails 2.4.2 plugin as a JAR dependency in a Grails 2.2.0 project

I have a custom plugin built using Grails 2.4.2 that is to be used with multiple Grails projects as a regular JAR dependency. I have successfully exported the plugin as JAR and installed into my local Maven repository and added the corresponding dependency statements in the "dependencies" block of the BuildConfig.groovy files of the respective parent projects. e.g.:
compile 'my_package:my_custom_plugin:1.0'
One of the parent project is build using Grails 2.4.2. When I run that project with the above mentioned configuration using the command: grails run-app, it runs fine without any errors.
However, when I do the same kind of configuration in another project built using Grails 2.2.0 and run it using the command: grails run-app, it gives the following error:
Error | Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/grails/datastore/mapping/dirty/checking/DirtyCheckable (Use --stacktrace to see the full trace)
NOTE: Both these parent projects run fine when I add the same plugin as a plugin instead of as a JAR dependency using the statement like this in the BuildConfig.groovy:
grails.plugin.location."my_custom_plugin" = "../my_custom_plugin/"
Can anybody kindly guide me as to how can I resolve this issue?
Any help would be greatly appreciated.

Grails Solr The import org.apache.solr cannot be resolved

Recently I changed my solr version from 3.5.0 to 4.8.0 in my grails project. Successfully the jar was downloaded and it is there in the local system but it was not included in project dependencies. It is showing error like The import org.apache.solr cannot be resolved
I tried grails clean and grails refresh-dependencies. But still it I getting the above error. I can someone suggest what might the issue is?
In my BuildConfig.groovy compile 'org.apache.solr:solr-solrj:4.8.0'

How to implement form builder plugin in grails

What steps will reproduce the problem?
1.create grails project on STS: 2.9.2
2.Open plugin manager, install form builder plugin.
1.Create grails project on NetBeans IDE 7.0
2.Open Grails Plugins. install form builder plugin.
1.Create grails application using command grails create-app test
2.install form builder plugin.
What is the expected output? What do you see instead?
Each time i was expecting plugin should install and i can run application, but getting several dependencies. I tried with/without changes made in BuildConfig.groovy.
What version of the product are you using? On what operating system?
I am working on
Java: 1.6.0_29; Java HotSpot(TM) Client VM 20.4-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
with grails 2.0.4
I have installed STS 2.9.2, STS 2.5.1, Netbeans 7.0 with grails plugin
Please provide any additional information below.
Each time i tried to install plugin it is showing me some run-time dependencies for jquery, jquery ui and others, I tried to install all plugins before installing form builder plugin. Now it is showing me some class missing
net.sf.json-lib:json-lib:2.4.
some time it is showing me error about
C:\Documents and Settings\jitendrakarma.grails\2.0.4\projects\FormTest\plugins\form-builder-0.1\grails-app\controllers\org\grails\formbuilder\FormController.groovy: 18: unable to resolve class freemarker.template.Template
# line 18, column 1.
import freemarker.template.Template
Please let me know what is wrong with the process i am following.
You are doing everything totally right. The plugin itself does not manage its dependencies correctly. Also it is belonging to some classes that doesn't exists any more in Grails >= 2.x.x
If you add all missing external dependencies and add the following entries to the plugin closure of grails-app/conf/BuildConfig.groovy
compile ":form-builder:0.1"
compile ":jquery-ui:1.8.6"
compile ":dynamic-domain-class:0.2.1"
compile ":jquery-json:2.2"
compile ":freemarker-tags:0.5.8"
compile ":uni-form:1.5"
compile ":jquery-datatables:1.7.5"
compile ":jquery-validation-ui:1.2"
compile ":lang-selector:0.3"
compile ":quartz:0.4.2"
compile ":jquery-form-builder:0.1"
and add the following entry to the dependencies section of the same file
compile 'org.freemarker:freemarker:2.3.19'
you will still get four compile errors.
One of them is: "unable to resolve class org.codehaus.groovy.grails.web.metaclass.TagLibDynamicMethods"
If you look up this class in the grails api documentation you will see it inside the grails 1.3.7 version but it is missing in the 2.0.4 version.
So the best thing I could recommend you is to search for another plugin or doing some code by your own.
Validation for example could be done with a Command on the grails side and the JQuery Validation Plugin on the client side. The form itself can be created with the help of scaffolding. Even if you don't need a domain you could create one run scaffolding to get the resulting form and throw away the domain.

Can't compile grails Tomcat plugin

I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files.
Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated.
java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper
Update I have tried grails clean, and used both grails 1.2.0 and 1.3.1
Update The project I've tried with tomcat is the base project generated by grails.
When you say "but the project isn't set up for Jetty and is missing files." what do you have in there that maybe clashing with Tomcat? It sounds like you must be using some specific tomcat functionality.

Grails not executing on IntelliJ (NoClassDefFoundError)

I have upgraded my application from grails 1.2.2 to 1.3.1-RC1. While things seem to work when executing grails from command prompt, I cannot make it run from my IDE IntelliJ (last development version).
The error I got straightaway is:
Error executing script RunApp: net/sf/json/JSONException
...
Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONException
Adding the library json-lib.jar to the modules dependencies does not change anything in IntelliJ.
Also, it seems that there are 2 JSONException classes defined in 2 different packages :
org.codehaus.groovy.grails.web.json in grails.jar
another package net.sf.json in json-lib-2.3-jdk15.jar located in lib folder of cloud-foundry plugin
Do you have any idea about what's happening?
In case, someone encountered the same problem, I finally managed to solve the issue without being sure what was the real fix.
In any case, my problem happened after I have upgraded my Grails from 1.2 to 1.3 and I had old libraries attached to plugins. What I did is:
Project Settings -> Modules -> irofoot-grailsPlugins -> Dependencies -> Grails User Library -> Edit -> Detach old libraries (with Grails-1.2 path)
and then it worked (no more ClassNotFoundException)!!

Resources