严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchFieldError: TRACE
at org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:492)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.trace(SLF4JLocationAwareLog.java:78)
at org.springframework.core.CollectionFactory.createConcurrentMapIfPossible(CollectionFactory.java:195)
at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:153)
at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2011-4-11 15:44:21 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2011-4-11 15:44:21 org.apache.catalina.core.StandardContext start
严重: Context [/crm] startup failed due to previous errors
2011-4-11 15:44:21 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8081
2011-4-11 15:44:21 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-4-11 15:44:21 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/16 config=null
2011-4-11 15:44:21 org.apache.catalina.startup.Catalina start
信息: Server startup in 28421 ms
web.xml如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- 上下文对象设置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<!-- 监听器的设置 当web应用一启动就 生成spring的上下文对象 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<!-- struts2的过滤器 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--
<welcome-file-list>
<welcome-file>/emp/add.jsp</welcome-file>
</welcome-file-list>
-->
<jsp-config>
<taglib>
<taglib-uri>http://displaytag.sourceforge.net/</taglib-uri>
<taglib-location>
/WEB-INF/displaytag-11.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
applicationContext.xml 如下:
<bean id="displaytagListAction" class="com.liuwei.crm.action.DisplaytagListAction">
<property name="empService" ref="empService"></property>
</bean>
<bean id="empService" class="com.liuwei.crm.service.impl.EmpServiceImpl">
<property name="displaytagEmpDao" ref="displaytagEmpDao"></property>
</bean>
<bean id="displaytagEmpDao" class="com.liuwei.crm.dao.hibernate.DisplaytagEmpDao">
</bean>
解决:
log4j版本的问题 把版本统一后 问题应该就可以解决了
把Tomcat下的log4j和项目里面的log4j 统一一下版本