使用 Spring/Log4j/Hibernate/Ant 访问 Web 应用程序时出现 Tomcat 错误[严重:错误监听器启动]?
我无法通过 Ant 访问部署在 tomcat 上的 Web 应用程序。它部署得很好,但是,当我访问它时,浏览器给了我 404 错误。 Catalina 日志给了我以下异常。以前它有效。我错过了什么吗?
Aug 11, 2011 12:06:47 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive customercare.war
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
Aug 11, 2011 12:07:01 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Aug 11, 2011 12:07:01 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/customercare] startup failed due to previous errors
Exception in thread "Timer-4" java.lang.NullPointerException
at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
I can't access my web application deployed on tomcat via Ant. It is deployed fine, but, when I access it, browser gave me 404 error. The catalina log gave me the following exception. It previously worked. Did I missed any thing?
Aug 11, 2011 12:06:47 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive customercare.war
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
Aug 11, 2011 12:07:01 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Aug 11, 2011 12:07:01 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/customercare] startup failed due to previous errors
Exception in thread "Timer-4" java.lang.NullPointerException
at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的记录器配置不正确:
导致错误的行位于外部
Log4jMLog
的内部类Log4jMLogger
导致错误的行是:
return logger.isEnabledFor( level(l) );
因此,您的堆栈跟踪意味着变量 logger 为 null。
Your logger is not configured right:
The line that causes the error is in the inner class
Log4jMLogger
of the outer oneLog4jMLog
The line that causes the error is:
return logger.isEnabledFor( level(l) );
So your stack trace means that the variable
logger
is null.