tomcat清除服务器历史数据:remove所有tomcat里面所有工程,再右键clean
tomcat启动显示以下警告之后没有反应:
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
网上贴出了各种解决办法我试了一下都不管用,这个错误信息应该是在加载spring的contextLoader时没有找到log4j造成的,所以解决方案很简单,就是把spring的配置contextConfigLocation放在log4j配置之后就OK了!我给大家贴出图,就一目了然了:
log4jConfigLocation /WEB-INF/log4j.properties<!-- 定义LOG4J监听器 -->
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
=======================================================================================================
contextConfigLocation /WEB-INF/applicationContext.xml org.springframework.web.context.ContextLoaderListener