maven项目启动tomcat8报错org.apache.catalina.core.StandardContext.startInternal One or more listeners faile

严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors

解决方案:根据报错信息,还不能获知是什么原因,需要进入日志信息查看详细报错原因

1.如果还没有配置日志信息,可以进行如下配置log4j.properties,若已配置则跳过此步骤

maven项目启动tomcat8报错org.apache.catalina.core.StandardContext.startInternal One or more listeners faile_第1张图片

log4j.properties内容如下

log4j.rootLogger=WARN, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.conversionPattern=%5p [%t] (%F:%L) - %m%n

2.在web.xml里面配上



log4jConfigLocation
classpath:properties/log4j.properties


log4j配置加载器
org.springframework.web.util.Log4jConfigListener

3.去apache-tomcat-8.5.33\logs下查看日志

java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: ServletContext resource [/classpath*:properties/log4j.properties] cannot be resolved to absolute file path - web application archive not expanded?

原因是:classpath后面多了个*

解决方案:去掉*,去查看一下自己的配置文件,将classpath后面的*都去掉

你可能感兴趣的:(Java,bug记录)