When I copied my old project from my old computer and typed grails run-app in project folder, I get the following error:
| Error Compilation error: startup failed:
G:\Windows NT 5.0 Workstation Profile\.grails\2.0.0\projects\timesheet\plugins\g
orm-labs-0.8.5\src\groovy\GormLabsHibernateCriteriaBuilder.groovy: 35: The retur
n type of java.lang.Object order(java.lang.String) in grails.orm.GormLabsHiberna
teCriteriaBuilder is incompatible with org.grails.datastore.mapping.query.api.Cr
iteria order(java.lang.String) in grails.orm.HibernateCriteriaBuilder
. At [35:5] # line 35, column 5.
Object order(String propertyName) {
^
1 error
Can anyone tell me what this relates to?
Thanks
You said you just copied the project, but you must have at least partially upgraded it since your error shows that you're using Grails 2.0.0. The error message has to do with the Gorm Labs plugin, which has been abandoned for over a year and is unlikely to be compatible with newer versions of Grails. I'd remove that and any usage of it and see where you get from there.
Related
I'm in process of upgrading an app from Grails v2 to v3 .
I got to a point where it works reasonably well with Grails 3.0.17.
I wanted to upgrade it to v3.1 or v3.2. But after changing the version in gradle.properties that's what I get after executing grails run-app:
me#host:[~/](feature/grails3-migration) : grails run-app
| Error Error occurred running Grails CLI: startup failed:
script14867378818131525390840.groovy: 3: unable to resolve class xxx.yyy.CollectorsJob
# line 3, column 1.
import xxx.yyy.jobs.CollectorsJob
^
script14867378818131525390840.groovy: 6: unable to resolve class xxx.yyy.domain.business.Company
# line 6, column 1.
import xxx.yyy.domain.business.Company
^
script14867378818131525390840.groovy: 5: unable to resolve class xxx.yyy.domain.access.User
# line 5, column 1.
import xxx.yyy.domain.access.User
^
...
There's about 15 errors like that printed.
What's the problem here? I've tried clear the project and change the jdk version fro 1.8 -> 1.7. Each time the same result.
If you are referencing application classes in grails-app/conf/application.groovy these will need to be moved to your runtime configuration in grails-app/conf/runtime.groovy
The application.groovy file is parsed by the build system in addition to the runtime so cannot contain references to classes that are not yet compiled
I'm trying to port my project from Grails 2.4 to 3.0. Nothing fancy: 12 Domains, 13 Controllers and a service.
Everything works fine, except when I try to include the Scaffolding plugin. I literally follow the manual here, but the syntax must be wrong. Adding the plugin line as specified:
plugins {
…
compile ":scaffolding:2.0.0"
…
}
leads to this:
BUILD FAILED
Total time: 1.559 secs
| Error Error initializing classpath: startup failed:
build file 'E:\GrailsIdeaProjects\HcaServer\build.gradle': 17: only id(String) method calls allowed in plugins {} script block
See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
# line 17, column 5.
compile ":scaffolding:2.0.0"
^
1 error
(Use --stacktrace to see the full trace)
Somebody knows the right syntax to include the Scaffolding plugin in Grails 3?
EDIT: Thanks to Casey for pointing me in the right direction: Scaffolding plugin is actually already included in default build.gradle. Anyway, i still get a webpage like this on every controller:
Error: Page Not Found (404)
Path: /*controllerName*/index
I've been using the same syntax as per the manual, declaring a static scaffold = true on each controller. Why do I get a 404 page then? I do have index.gsp, error.gsp and notFound.gsp in my views folder.
It looks like that documentation hasn't been updated for Grails 3.0 yet. Your build.gradle file should have a dependencies block, where you can specify the dependency:
dependencies {
// ...
runtime "org.grails.plugins:scaffolding"
}
You can also see this by creating a new app using Grails 3.0 and checking out the default build.gradle file.
After researching for a while, turns out dynamic scaffolding hasn't made it yet into Grails 3:
https://groups.google.com/forum/m/#!topic/grails-dev-discuss/6R2YaF96Uts
Try this, It works for me.
dependencies {
compile "org.grails.plugins:scaffolding"
}
I am using grails 3.09.
I am using Grails 2.2.2 with GGTS 3.3M1. When I run my app (grails run-app) and change something in a groovy file then Grails recompiles the file. During this process the following error output occurs:
| Error Unexpected problem clearing ThreadGroupContext beaninfo:
| Error java.lang.ClassCastException: java.beans.WeakIdentityMap cannot be cast to java.util.Map
| Error at org.springsource.loaded.agent.JVMPlugin.reloadEvent(JVMPlugin.java:77)
| Error at org.springsource.loaded.TypeRegistry.fireReloadEvent(TypeRegistry.java:1594)
| Error at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:396)
| Error at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:805)
| Error at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:51)
| Error at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:218)
| Error at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:205)
| Error at java.lang.Thread.run(Thread.java:722)
Reloading: JVMPlugin: warning: unable to clear BEANINFO_CACHE, cant find field
The compilation seems to work fine but the error still occurs.
This is because you are on JDK 1.7 update 21. Something 'moved' in the JDK at that version and the state clearing logic needs updating in springloaded. This is already fixed in the springloaded codebase but won't be in a new grails version for a little while. Older versions of JDK 1.7 would be fine. You can ignore the message, but it means some state was not cleared when a type was reloaded - and this means it may look like it hasn't reloaded some of the changes you might make to your types.
I've installed the newest Grails PayPal-Plugin (0.6.4) and got the following error:
Problems occurred (un)installing plugins. See details for more information
------System.out:-----------
| Loading Grails 2.0.0
| Configuring classpath.
| Environment set to development.....
| Compiling 97 source files
| Compiling 97 source files.
| Error Compilation error: startup failed:
C:\Users\username\.grails\2.0.0\projects\projectname\plugins\paypal-0.6.4\grails-app\controllers\org\grails\paypal\PaypalController.groovy: -1: The return type of java.lang.Object notify() in org.grails.paypal.PaypalController is incompatible with void notify() in java.lang.Object
. At [-1:-1] # line -1, column -1.
1 error
------System.err:-----------
I fixed it by renaming notify() into notifyPaypal() => Error PayPal plugin on grails 2.0.0.RC3
But the plugin seems to disturb springSecurity because I got the following error if I try to login:
| Error 2012-02-05 21:42:07,245 ["http-bio-8080"-exec-8] ERROR [/projectname].[default] - Servlet.service() for servlet [default] in context with path [/projectname] threw exception
Message: The specified user domain class 'Person' is not a domain class
How can I fix it?
Notice that two versions have been released since 0.6.4, and it now behaves as you asked regarding the 'notify()' method (probably thanks to your report).
http://grails.org/plugin/paypal/
(just saying it here for any casual reader to know)
I am trying to run a sample project, but I am getting this error on the console and the app does not run.
I don't understand what this error means.
Packaging project ScheduleAir
C:\Eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\bin\rapc.exe -quiet codename=deliverables\Standard\4.5.0\scheduleair deliverables\Standard\4.5.0\scheduleair.rapc -sourceroot=C:\Documents and Settings\20041\workspace\ScheduleAir\src\com\intellisoft\schedule_air;C:\Documents and Settings\20041\workspace\ScheduleAir\src;C:\Documents and Settings\20041\workspace\ScheduleAir\res -import=C:\Eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\lib\net_rim_api.jar C:\Documents and Settings\20041\workspace\ScheduleAir\bin
Error preverifying class com.intellisoft.schedule_air.AppSettingScreen
VERIFIER ERROR com/intellisoft/schedule_air/AppSettingScreen.()V:
Illegal type in constant pool
Error!: Error: preverifier failed: C:\Eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\bin\preverify.exe -d C:\DOCUME ...
Packaging project ScheduleAir failed (took 0.437 seconds)
Could it be related to compiler target level in your Eclipse? For BB it should be set to 1.3, while by default Eclipse sets it to 1.5/1.6. Check "More detail on preverification errors ?" for details.
You must set JAVA_HOME in your system environment variables