Grails Version: 2.3.11
Java Version: 1.8.91
JBoss AS Version: 10.1.0
Gradle Version: 3.2.1
Grails application build runs successfully. But when I deploy build on JBoss Wildfly 10 it does not deployed and failed with error. Below is stacktrace printed on console.
java.lang.RuntimeException: org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NullPointerException
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NullPointerException
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NullPointerException
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:132)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
... 8 more
Caused by: java.lang.NullPointerException
at BootStrap$_closure1.doCall(BootStrap.groovy:24)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
at grails.util.Environment.executeForEnvironment(Environment.java:301)
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277)
... 19 more
I have deleted gradle cache from directory <user_home>/.gradle/ and grails cache from <user_home>/.grails/2.3.11 and build the project. But getting same error.
Any idea/suggestion where this is going wrong?
Related
hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.WebAppMain$3.run(WebAppMain.java:237) Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269) at jenkins.InitReactorRunner.run(InitReactorRunner.java:44) at jenkins.model.Jenkins.executeReactor(Jenkins.java:910) at jenkins.model.Jenkins.<init>(Jenkins.java:818) at hudson.model.Hudson.<init>(Hudson.java:85) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.WebAppMain$3.run(WebAppMain.java:225) Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:176) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$7.runTask(Jenkins.java:899) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:106) ... 8 more Caused by: java.lang.NoSuchMethodError: jenkins.model.Jenkins.get()Ljenkins/model/Jenkins; at org.jenkinsci.plugins.workflow.cps.nodes.StepDescriptorCache.getPublicCache(StepDescriptorCache.java:48) at org.jenkinsci.plugins.workflow.cps.nodes.StepDescriptorCache.invalidateGlobalCache(StepDescriptorCache.java:55) ... 13 more
i checked few solutions like delete all plugins etc, but did not work , any help is appreciated
before updating any plugin , take a backup of plugins folder.
i just restored the plugins folder and i am able to boot the jenkins now
I am using Grails 3.0.5
I get this error when trying to deploy using java -Dgrails.env=prod -jar
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Grails application running at http://localhost:8080 in environment: production
ERROR StackTrace - Full Stack Trace:
org.grails.taglib.GrailsTagException: [views/layouts/secure0.gsp:142] Error executing tag <g:render>: PermGen space
at org.grails.gsp.GroovyPage.throwRootCause(GroovyPage.java:445) ~[grails-gsp-3.0.5.jar!/:3.0.5]
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:388) ~[grails-gsp-3.0.5.jar!/:3.0.5]
at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_79]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) ~[groovy-2.4.4.jar!/:2.4.4]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.4.jar!/:2.4.4]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) ~[groovy-2.4.4.jar!/:2.4.4]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019) ~[groovy-2.4.4.jar!/:2.4.4]
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) ~[groovy-2.4.4.jar!/:2.4.4]
Before deployment, I test in localhost, and it runs without any error.
But after deployment I get this error.
What's wrong with my code?
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Grails application running at http://localhost:80 in environment: production
ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDis patcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in con text with path [] threw exception [Handler processing failed; nested exception i s java.lang.OutOfMemoryError: PermGen space] with root cause
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_79]
at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[na:1.7.0_79 ]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 2) ~[na:1.7.0_79]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[na:1.7 .0_79]
at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0 _79]
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_79]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_79]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0 _79]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0 _79]
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(La unchedURLClassLoader.java:163) ~[ChatV3-0.1.jar!/:na]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(Laun chedURLClassLoader.java:136) ~[ChatV3-0.1.jar!/:na]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_79]
at org.grails.buffer.StreamCharBuffer$MultipartCharBufferChunk.asStringC hunk(StreamCharBuffer.java:1864) ~[grails-encoder-3.0.5.jar!/:3.0.5]
at org.grails.buffer.StreamCharBuffer.readToSingleStringChunk(StreamChar Buffer.java:720) ~[grails-encoder-3.0.5.jar!/:3.0.5]
at org.grails.buffer.StreamCharBuffer.toString(StreamCharBuffer.java:700 ) ~[grails-encoder-3.0.5.jar!/:3.0.5]
at org.grails.buffer.FastStringWriter.getValue(FastStringWriter.java:63) ~[grails-encoder-3.0.5.jar!/:3.0.5]
at org.grails.buffer.FastStringWriter.toString(FastStringWriter.java:59) ~[grails-encoder-3.0.5.jar!/:3.0.5]
at org.grails.web.pages.GroovyPagesUriSupport.getAbsoluteViewURIInternal (GroovyPagesUriSupport.java:225) ~[grails-web-common-3.0.5.jar!/:3.0.5]
at org.grails.web.pages.GroovyPagesUriSupport.getAbsoluteViewURI(GroovyP agesUriSupport.java:161) ~[grails-web-common-3.0.5.jar!/:3.0.5]
at org.grails.web.gsp.io.GrailsConventionGroovyPageLocator.findViewByPat h(GrailsConventionGroovyPageLocator.java:68) ~[grails-web-gsp-3.0.5.jar!/:3.0.5]
at org.grails.web.servlet.view.GroovyPageViewResolver.createGrailsView(G roovyPageViewResolver.java:186) ~[grails-web-gsp-3.0.5.jar!/:3.0.5]
at org.grails.web.servlet.view.GroovyPageViewResolver$1.call(GroovyPageV iewResolver.java:113) ~[grails-web-gsp-3.0.5.jar!/:3.0.5]
at org.grails.web.servlet.view.GroovyPageViewResolver$1.call(GroovyPageV iewResolver.java:110) ~[grails-web-gsp-3.0.5.jar!/:3.0.5]
at grails.util.CacheEntry.updateValue(CacheEntry.java:170) ~[grails-core -3.0.5.jar!/:3.0.5]
at grails.util.CacheEntry.getValue(CacheEntry.java:144) ~[grails-core-3. 0.5.jar!/:3.0.5]
at grails.util.CacheEntry.getValue(CacheEntry.java:84) ~[grails-core-3.0 .5.jar!/:3.0.5]
at grails.util.CacheEntry.getValue(CacheEntry.java:102) ~[grails-core-3. 0.5.jar!/:3.0.5]
at org.grails.web.servlet.view.GroovyPageViewResolver.loadView(GroovyPag eViewResolver.java:124) ~[grails-web-gsp-3.0.5.jar!/:3.0.5]
at grails.plugin.scaffolding.ScaffoldingViewResolver.loadView(Scaffoldin gViewResolver.groovy:36) ~[scaffolding-3.1.1.jar!/:na]
at org.springframework.web.servlet.view.AbstractCachingViewResolver.crea teView(AbstractCachingViewResolver.java:244) ~[spring-webmvc-4.1.7.RELEASE.jar!/ :4.1.7.RELEASE]
at org.springframework.web.servlet.view.UrlBasedViewResolver.createView( UrlBasedViewResolver.java:446) ~[spring-webmvc-4.1.7.RELEASE.jar!/:4.1.7.RELEASE ]
at org.springframework.web.servlet.view.AbstractCachingViewResolver.reso lveViewName(AbstractCachingViewResolver.java:146) ~[spring-webmvc-4.1.7.RELEASE. jar!/:4.1.7.RELEASE]
ERROR StackTrace - Full Stack Trace:
org.grails.taglib.GrailsTagException: [views/layouts/main.gsp:8] Error executing tag <asset:stylesheet>: PermGen space
at org.grails.gsp.GroovyPage.throwRootCause(GroovyPage.java:445) ~[grail s-gsp-3.0.5.jar!/:3.0.5]
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:388) ~[grails-gsp -3.0.5.jar!/:3.0.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7. 0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) ~[na:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) ~[na:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_79]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java: 93) ~[groovy-2.4.4.jar!/:2.4.4]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2
ERROR org.apache.catalina.core.ContainerBase - Unexpected death of background thread ContainerBackgroundProcessor[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
java.lang.OutOfMemoryError: PermGen space
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ContainerBackgroundProcessor[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]"
This is what I try to do..
[root#server chat]# export GRAILS_OPTS="-server -d64 -XX:MaxPermSize=1024 -Xmx1024m"
[root#server chat]# java -Dgrails.env=prod -jar ChatV3-0.1.jar
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Grails application running at http://localhost:80 in environment: production
ERROR asset.pipeline.AssetSpecLoader - Error loading asset specification asset.pipeline.CssAssetFile: PermGen space
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_79]
at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[na:1.7.0_79]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.7.0_79]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[na:1.7.0_79]
at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0_79]
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_79]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_79]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_79]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_79]
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:163) ~[ChatV3-0.1.jar!/:na]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:136) ~[ChatV3-0.1.jar!/:na]
When I tried to get Java
[root#server chat]# ps -ax | grep java
3700 ? Sl 1:27 /usr/java/jdk1.7.0_79/bin/java -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/root/apache-activemq/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/root/apache-activemq/tmp -Dactivemq.classpath=/root/apache-activemq/conf; -Dactivemq.home=/root/apache-activemq -Dactivemq.base=/root/apache-activemq -Dactivemq.conf=/root/apache-activemq/conf -Dactivemq.data=/root/apache-activemq/data -jar /root/apache-activemq/bin/activemq.jar start
11544 pts/0 S+ 0:00 grep --color=auto java
You got a PermGen error.
Try using somethink like:
$ export GRAILS_OPTS="-XX:MaxPermSize=1024m -Xmx1024M -server"
$ java -Dgrails.env=prod -jar
Take a look on this questions/answers, they will help you:
Grails and PermGen issue with g:link and g:render
Grails PermGem error
I resolve my problem with
java -XX:MaxPermSize:1024m -Dgrails.env=prod -jar hellowWorld.jar
I'm having an issue using Grails on my machine... Java's installed, Groovy's working, but Grails always fails with a RootLoader class not found issue.
I've tried multiple Java/Groovy/Grails combinations to no effect.
Here's the entire output of my console
C:\Users\west>groovy --version
Groovy Version: 2.4.3 JVM: 1.7.0_45 Vendor: Oracle Corporation OS: Windows 7
C:\Users\west>grails --version
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/t
ools/RootLoader
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.RootLoade
r
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
Trying to get our application up and running with 2.4.0.RC1 and I keep running into this error:
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
... 4 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:46)
... 4 more
Caused by: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName(Class.java:190)
at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:43)
... 4 more
I've upgraded to the latest version of cache (1.1.6). It seems like some kind of version conflict with the spring cache stuff, but I checked the dependency report and didn't see anything unusual being pulled in.
Anyone else run into this problem and have a solution?
It turns out that spring-integration-core version 3.0.3 was including an older version of spring-context that I missed.
Upgrading to spring-integration-core version 4.0.0 uses the same version of Spring 4 as Grails.
I've installed ubuntu 10.10 in my system and installed ant with the following command:
sudo apt-get install ant
Now, ant is visible in the share folder, so I've tried to run the ant command in terminal, but it gives me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.tools.ant.launch.Launcher. Program will exit.
Then I set these again:
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.22/"
ANT_HOME="/usr/share/ant/"
PATH="/usr/share/ant/bin/"
Now it is giving me the same error but with one different line at starting:
/usr/share/ant/bin/ant: 92: uname: not found
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.tools.ant.launch.Launcher. Program will exit.
try the following:
JAVA_HOME="/usr/lib/jvm/java-6-sun"
ANT_HOME="/usr/share/ant" # do not add "bin" at the end of the path**
PATH="$ANT_HOME/bin:$PATH"