错误信息
在出现以下信息:
信息: Initializing Spring root WebApplicationContext 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.
和服务器错误信息
web.xml的spring配置
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
只有以上的listener,但是它的文档写着
Bootstrap listener to start up and shut down Spring’s root WebApplicationContext. Simply delegates
to ContextLoader as well as to ContextCleanupListener.
This listener should be registered after org.springframework.web.util.Log4jConfigListener in web.xml,
if the latter is used.
As of Spring 3.1, ContextLoaderListener supports injecting the root web application context via the
ContextLoaderListener(WebApplicationContext) constructor, allowing for programmatic configuration
in Servlet 3.0+ environments. See org.springframework.web.WebApplicationInitializer for usage
examples.
需要修改的地方
- web.xml