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)
Related
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.
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.
When I'm, trying to create and execute new project in GGTS using grails 2.3.8 I have this issue:
Loading Grails 2.3.8
Error |
java.lang.NoClassDefFoundError: Could not initialize class
org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver
Error |
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.getAvailableScripts(GrailsScriptRunner.java:817)
Error |
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:427)
Error |
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:421)
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:57)
Error |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error |
at java.lang.reflect.Method.invoke(Method.java:606)
Error |
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:235)
Error |
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:263)
How it can be solved?
I started getting the following exception on startup recently:
Error log4j:ERROR setFile(null,false) call failed.
| Error java.io.FileNotFoundException: /var/log/log4j/log4jEvents.xml (No such file or directory)
| Error at java.io.FileOutputStream.open(Native Method)
| Error at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
| Error at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
| Error at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
| Error at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
| Error at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
| Error at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:295)
| Error at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
| Error at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
| Error at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
| Error at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)
| Error at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004)
| Error at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
| Error at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
| Error at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
| Error at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
| Error at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:415)
| 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.GrailsScriptRunner.initializeLogging(GrailsScriptRunner.java:659)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.initializeState(GrailsScriptRunner.java:631)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:414)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:379)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:227)
| 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:236)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)
| 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
It doesn't seem to affect anything, but it is a bit annoying. I'm guessing some plugin or dependency that has been put in recently caused this to start happening, because it wasn't always there. I have not been able to track down what it is that's causing it, so I was hoping that maybe someone here had an idea?
I am using Grails 2.3.1 and GGTS 3.4
When I try to start the grails application from within GGTS I get the below error
If I run the application from command line it works fine. I also tried to create the application from within GGTS and it also gives the same below error.
I tried deleting the folder for .slcache and also restarted the machine but same issue. Could not find reference for this issue elsewhere. Is this an issue
Loading Grails 2.3.1
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
| Error java.io.FileNotFoundException: C:\Users\Admin\.grails\2.3.1\.slcache\.index (The process cannot access the file because it is being used by another process)
| Error at java.io.FileOutputStream.open(Native Method)
| Error at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
| Error at java.io.FileWriter.<init>(FileWriter.java:107)
| Error at org.springsource.loaded.MethodInvokerRewriter.addToCacheIndex(MethodInvokerRewriter.java:379)
| Error at org.springsource.loaded.MethodInvokerRewriter.rewrite(MethodInvokerRewriter.java:321)
| Error at org.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:154)
| Error at org.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java:791)
| Error at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:265)
| Error at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
| Error at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
| Error at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
| Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
| Error at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
| Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
| Error at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
| Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
| Error at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
| Error at org.slf4j.impl.GrailsSlf4jLoggerFactory.getLogger(GrailsSlf4jLoggerFactory.java:44)
| Error at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
| Error at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
| Error at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:291)
| Error at org.apache.commons.logging.LogFactory$getLog.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:116)
| Error at org.grails.plugins.tomcat.fork.ForkedTomcatServer.<clinit>(ForkedTomcatServer.groovy:39)
It's an old thread but it may help someone.
There's seems to be a problem with .grails folder located in the home directory.
Either it doesn't exist. If it's so then create one.
Or you don't have permission to access that .grails folder. It it's so then change the permission using chown command.
After completing either of the above steps, clean your grails project and restart your IDE.