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,若已配置则跳过此步骤

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里面配上

<!-- log4j日志配置 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:properties/log4j.properties</param-value>
</context-param>
<listener>
<description>log4j配置加载器</description>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

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后面的*都去掉

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值