tomcat部署出错,烦请帮忙看一下
用的是grails war生成的war,放到tomcat的webapps下面。出错
输出内容是:
十一月 14, 2013 1:44:25 下午 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
十一月 14, 2013 1:44:25 下午 org.apache.catalina.core.StandardContext start
严重: Context [/ehrgen-1.4-0.8b3] startup failed due to previous errors
error输出是:
013-11-14 13:43:30,259 ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:900)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:455)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:294)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:69)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:215)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
at org.codehaus.groovy.grails.commons.AbstractGrailsClass.newInstance(AbstractGrailsClass.java:121)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.initialisePlugin(DefaultGrailsPlugin.java:129)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.<init>(DefaultGrailsPlugin.java:106)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.<init>(DefaultGrailsPlugin.java:255)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.createGrailsPlugin(DefaultGrailsPluginManager.java:350)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.findUserPlugins(DefaultGrailsPluginManager.java:376)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:287)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:239)
at org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet(GrailsPluginManagerFactoryBean.java:105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 37 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at HibernateGrailsPlugin.class$(HibernateGrailsPlugin.groovy)
at HibernateGrailsPlugin.$get$$class$org$codehaus$groovy$grails$plugins$orm$hibernate$HibernatePluginSupport(HibernateGrailsPlugin.groovy)
at HibernateGrailsPlugin.<init>(HibernateGrailsPlugin.groovy:51)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
2013-11-14 13:44:25,851 ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [HibernateGrailsPlugin]!
... 1 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Environment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at HibernateGrailsPlugin.class$(HibernateGrailsPlugin.groovy)
at HibernateGrailsPlugin.$get$$class$org$codehaus$groovy$grails$plugins$orm$hibernate$HibernatePluginSupport(HibernateGrailsPlugin.groovy)
at HibernateGrailsPlugin.<init>(HibernateGrailsPlugin.groovy:51)
... 1 more
/WEB-INF/applicationContext.xml里面的pluginManager部分是
<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="application" ref="grailsApplication" />
</bean>
[解决办法]
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
没有 LoggerFactory 这个类。
找个 slf4j-api.jar 的jar包装上就好了。
[解决办法]