grails errors on all commands - grails

I need to get grails working to compile asgard from netflix, but I seem to be hitting an issue that i have yet to find a solution for.
$ $GRAILS_HOME/bin/grails help
| Error java.lang.reflect.InvocationTargetException
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| Error at java.lang.reflect.Method.invoke(Method.java:597)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.IllegalAccessError: class sun.reflect.GeneratedMethodAccessor1 cannot access its superclass sun.reflect.MethodAccessorImpl
| Error at sun.misc.Unsafe.defineClass(Native Method)
| Error at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
| Error at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
| Error at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:59)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:28)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| Error at java.lang.reflect.Method.invoke(Method.java:597)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:252)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
| Error at grails.util.BuildSettings.establishProjectStructure(BuildSettings.groovy:1452)
| Error at grails.util.BuildSettings.setBaseDir(BuildSettings.groovy:835)
| Error at grails.util.BuildSettings$setBaseDir.callCurrent(Unknown Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
| Error at grails.util.BuildSettings.<init>(BuildSettings.groovy:774)
| Error at grails.util.BuildSettings.<init>(BuildSettings.groovy:749)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:164)
| Error ... 6 more
$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
The zip file for 2.1.1 is from the grails site and i have yet to find anything missing. All grails commands are doing this.
Am i missing something?

Are you following asgard reccomandation??
Run Sun/Oracle Java 6 on Linux or Mac
Avoid Java 7
Avoid OpenJDK
Avoid Windows
Yes, Asgard runs on Grails, and Grails runs on Java, and Java is supposed to be "run
anywhere", except for the fact that Asgard users have reported incompatibility problems with
Java 7, OpenJDK, and Windows. A future version of Asgard will be Java 7 compatible, and
perhaps it will work with OpenJDK eventually. The Windows issue is less likely to get
debugged by Netflix engineers, but if you figure it out feel free to send a pull request.

Related

Error in Groovy/Grails tool suite with grails project

Hi i am new to Groovy/Grails and i recently installed Groovy/Grails suite 3.6.4 on windows 7. I made my JAVA_HOME and GRAIL_HOME and when i tried to run a Grails application i get the following errors.
Error
|
java.io.FileNotFoundException: C:\Users\οΏ½οΏ½οΏ½\Documents\workspace-ggts-3.6.4.RELEASE\.metadata\.plugins\org.grails.ide.eclipse.core\as-dependencies.txt (The system cannot find the path specified)
Error |
at java.io.FileOutputStream.open0(Native Method)
Error |
at java.io.FileOutputStream.open(FileOutputStream.java:270)
Error |
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
Error |
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
Error |
at org.grails.ide.eclipse.runtime.shared.DependencyFileFormat$DepWriter.<init>(DependencyFileFormat.java:55)
Error |
at org.grails.ide.eclipse.runtime.shared.DependencyFileFormat.write(DependencyFileFormat.java:106)
Error |
at org.grails.ide.eclipse.runtime.GrailsBuildSettingsDependencyExtractor.writeDependencyFile(GrailsBuildSettingsDependencyExtractor.java:206)
Error |
at org.grails.ide.eclipse.longrunning.process.GrailsProcess.writeDependencyFile(GrailsProcess.java:200)
Error |
at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:133)
Error |
at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:93)
Error |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Error |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error |
at java.lang.reflect.Method.invoke(Method.java:498)
Error |
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:236)
Error |
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)

GGTS Convert to Grails fails with NoClassDefFoundError

I've imported a Grails project and am attempting to "convert it to grails". When I do this, I"m getting a NoClassDefFound on the apache commons logging package. Where do I add the jar for this? Is this in the IDE's class path, the Grails class path or the app's class path? It does not appear to be in grails-2.2.4/lib. That is the first place I'd expect it. This appears to use Ivy, so should that come as a dependency? Below is the error I'm seeing:
Loading Grails 2.2.4
| Error java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
| Error at org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver.<clinit>(PathMatchingResourcePatternResolver.java:136)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.getAvailableScripts(GrailsScriptRunner.java:813)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:423)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:417)
| Error at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand(GrailsConnectorImpl.java:160)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:130)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:93)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:483)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
| Error at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:175)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| Error at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147)
| Error at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:52)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| Error ... 13 more
Remove jdk1.8. I had both 1.7 and 1.8 jdks installed and 1.8 was my default runtime for osx. The project was specified as 1.7 but GGTS is looking at the default java runtime. After removing 1.8, it all works as expected.

Grails Plugin Creation: "No file extensions list found for path not being watched"

I've created a Grails plugin using grails create-plugin with Grails v2.4.3.
I've added the Tomcat plugin to the BuildConfig.groovy with
build(":tomcat:7.0.55") {
export = false
}
* Edit: I've placed this project on GitHub.
I start the plugin with grails run-app. The plugin loads and I can see a dummy controller I created.
I'd like plugin development to work like regular ol' Grails development. If I run it and make a change, it would be nice to have the change hot-reloaded instead of having to restart it.
If I make any change, it does not update the running plugin. Instead, I receive the error,
* Edit: This error also happens in any project that uses the plugin, effectively breaking development mode.
| Error java.lang.IllegalStateException: No file extensions list found for path not being watched
| Error at org.codehaus.groovy.grails.compiler.WatchServiceDirectoryWatcher.run(WatchServiceDirectoryWatcher.java:87)
| Error at org.codehaus.groovy.grails.compiler.DirectoryWatcher.run(DirectoryWatcher.java:154)
| Error at org.codehaus.groovy.grails.project.compiler.GrailsProjectWatcher.run(GrailsProjectWatcher.java:161)
| Error at java_lang_Runnable$run.call(Unknown Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.startProjectWatcher(ForkedGrailsProcess.groovy:748)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1152)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure17.doCall(ForkedGrailsProcess.groovy:737)
| Error at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure17.doCall(ForkedGrailsProcess.groovy)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
| Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
| Error at groovy.lang.Closure.call(Closure.java:423)
| Error at groovy.lang.Closure.call(Closure.java:417)
| Error at groovy.lang.Closure.run(Closure.java:504)
| Error at java.lang.Thread.run(Thread.java:722)
WARNING: There was an error setting up reloading. Changes to classes will not be reflected: No file extensions list found for path not being watched
Anyone have any ideas? Any way to make this work?
I can reproduce the issue, it looks like a bug. I have created a bug report: https://jira.grails.org/browse/GRAILS-11665.
It is not clear to me why it is also triggered by an installed plugin.

installing a local dojo plugin on grails 2.2.3

I'm trying to install a dojo plugin plugin from a local directory, but I get a grails error:
plugin not found.
The problem is that I try to do something kind new for using the dojo 1.9 librery. I am using Ubuntu 10.04, 64 bit architecture, and the Spring IDE GGSTS. I am trying to install default dojo plugin (1.7) on grails from the internet that downloads the plugin to a local directory. The thing lay on the modification of the related plugin, uncompressed it, change the dojo library on web-app/js/dojo directory for the update one dojo 1.9. files. Then uninstall dojo plugin, remove the dojo cache on .grails/ivy-cache/org.grails.pluggin/ and on the .grails/GRAILS_VERSION/project/_PROJECT. After these, only rest the modified plugin installation by install-plugin command. The problem is that grails return an error:
plugin () not found
Loading Grails 2.2.3
| Configuring classpath.
| Environment set to development.....
| Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Resolving plugin /home/israel/dojo-1.7.2.0.zip. Please wait...
| Error resolving plugin [name:/home/israel/dojo-1.7.2.0.zip, group:org.grails.plugins, version:latest.integration]. Plugin not found.
| Error Plugin not found for name [/home/israel/dojo-1.7.2.0.zip] and version [not specified]
| Error Error installing plugin: null (Use --stacktrace to see the full trace)
| Error org.codehaus.groovy.grails.cli.ScriptExitException
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
| Error at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
| Error at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
| Error at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:616)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
| Error at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
With current Grails version 2.2.3 you are using, install-plugin has been deprecated. You need to define it in your buildConfig. If you have the plugin in maven repository just define it in plugins dsl otherwise you need to define it inline using grails.plugin.location here. Take a look at creating and installing plugins.

Grails not running

I am trying to run grails in my laptop, I have installed jdk 1.8.0 and jre8, I have set JAVA_HOME and GRAILS_HOME correctly. When I type %JAVA_HOME% or %GRAILS_HOME% in command prompt, it displays correct paths. But when I try to run any grails command, I get the following error:
| Loading Grails 2.1.1
| Error java.lang.reflect.InvocationTargetException
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:491)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:491)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
| Error at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1208)
| Error at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source)
| Error at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1121)
| Error at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1003)
| Error at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
| Error at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:978)
My laptop has windows 8.
Any help regarding this would be greatly appreciated.
I was using java8, I tried using java7 and it worked fine! Apparently grails does not work with java8
grails 2.4 works with jdk - 8. grails 2.1.1 works with jdk - 7.
Switch to Grails 2.5.0 to run on jdk8u40+.
Also, if you are using the IDE GGTS, make sure it is v3.6.4, and that you install Groovy 2.4 from the extensions page to get the show on the road.
for my case, I re-synced the JDK home link. I use quite a few java versions these days.
after install the intrusive jdk1.8.0_51. THE /Library/Java/Home get overridden (maybe in most cases intended). if you just want to play with jdk1.8 and works mainly under other versions, you should link this place back
Now Grails 3+ version support java8 and there are lots of feature with new build system and also integrated spring boot. So you can update your project with grails 3+ version. But you need to Change your application architecture cause of spring boot and gradle build system.

Resources