Closed songday closed 9 years ago
Please upload an example and provide steps to reproduce
Please pull source from here: https://github.com/songday/songday
reproduce steps: for this exception
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.3-bin.zip'.
cd git/songday grails prod run-app --stacktrace (since prod db is PostgreSQL, you may need to change DataSource)
for below exception
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/support/TransactionManagerAware
wrap app to a war file, and deploy to Tomcat 8.0.18 when Tomcat starting, shows this error
Does anybody know how to resolve this? Urgent, Thanks :)
@songday Your example application runs fine in both OS X and Ubuntu in my local testing using both grails prod run-app
and deploying to Tomcat 8 as a WAR file.
The issue must be something to do with your local environment. If you could maybe post the full stack trace we could possibly understand the problem better from that.
Thanks for your reply
full stack trace of Tomcat
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.18
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 23 2015 11:56:07 UTC
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.18.0
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jre1.8.0_45
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_45-b15
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: F:\迅雷下载\apache-tomcat-8.0.18
09-Jul-2015 15:26:33.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: F:\迅雷下载\apache-tomcat-8.0.18
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UnlockCommercialFeatures
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+FlightRecorder
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms2048M
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx2048M
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=F:\迅雷下载\apache-tomcat-8.0.18\conf\logging.properties
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=F:\迅雷下载\apache-tomcat-8.0.18\endorsed
09-Jul-2015 15:26:33.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=F:\迅雷下载\apache-tomcat-8.0.18
09-Jul-2015 15:26:33.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=F:\迅雷下载\apache-tomcat-8.0.18
09-Jul-2015 15:26:33.190 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=F:\迅雷下载\apache-tomcat-8.0.18\temp
09-Jul-2015 15:26:33.190 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\VisualSVN Server\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;.
09-Jul-2015 15:26:33.270 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
09-Jul-2015 15:26:33.320 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Jul-2015 15:26:33.320 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 380 ms
09-Jul-2015 15:26:33.340 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
09-Jul-2015 15:26:33.340 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.18
09-Jul-2015 15:26:39.799 SEVERE [Catalina-startStop-1] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:868)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 6 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in tourting_backend.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/support/TransactionManagerAware
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:116)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:117)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:108)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:68)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/support/TransactionManagerAware
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 26 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/orm/support/TransactionManagerAware
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2472)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:854)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
at grails.boot.config.GrailsAutoConfiguration.scanUsingPattern(GrailsAutoConfiguration.groovy:102)
at grails.boot.config.GrailsAutoConfiguration.classes(GrailsAutoConfiguration.groovy:53)
at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 27 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.orm.support.TransactionManagerAware
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
... 42 more
09-Jul-2015 15:26:40.089 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:925)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:868)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
09-Jul-2015 15:26:40.189 SEVERE [main] org.apache.catalina.startup.Catalina.start The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:925)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
09-Jul-2015 15:26:40.259 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-80"]
09-Jul-2015 15:26:40.269 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
09-Jul-2015 15:26:40.269 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-80"]
09-Jul-2015 15:26:40.279 SEVERE [main] org.apache.coyote.AbstractProtocol.destroy Failed to destroy end point associated with ProtocolHandler ["http-nio-80"]
java.lang.NullPointerException
at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:307)
at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:482)
at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:795)
at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:532)
at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:588)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:859)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Tomcat runs on Windows 7 & Java 1.8.0_45
I found the reason, I upgrade Grails from 2.4.4 to 3.0.2 I resolved after removing some old files
Tomcat now don't throw exception, but always in development environment
When I add -Dgrails.env=prod got another exception :)
digging
Hi I was running locally with env=dev, everything is fine
when I switch to env=prod, I ran into:
Actually, I installed Gradle 2.3
Then, I created war file and deployed to Tomcat 8.0.18 and got another exception
I googled for solution but found nothing