近日部署项目到Tomcat,访问一直404。

于是查看 catalina.out 日志信息,发现如下信息

30-Jun-2019 16:38:03.642 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
30-Jun-2019 16:38:03.646 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/XXX] startup failed due to previous errors

其实还是没有看明白原因,只知道项目启动失败

再次查看 localhost.2019-06-30.log 发现如下循环输出的异常信息:

30-Jun-2019 16:13:56.351 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
java.lang.StackOverflowError
at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39)
at org.apache.log4j.LogManager.getLogger(LogManager.java:45)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:66)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
at org.apache.log4j.Category.<init>(Category.java:57)
at org.apache.log4j.Logger.<init>(Logger.java:37)
at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:43)
at org.apache.log4j.LogManager.getLogger(LogManager.java:45)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:66)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
at org.apache.log4j.Category.<init>(Category.java:57)
at org.apache.log4j.Logger.<init>(Logger.java:37)

 

推测是jar包冲突:log4j-over-slf4j.jar 和 slf4j-log4j12.jar

果然在 WEB-INF\lib 里面找到这两个家伙,于是先删除log4j-over-slf4j.jar,在重启tomcat,通过浏览器能够正常访问。

我们的是maven项目,用的Idea。

打开pom.xml文件

右键 -> Maven -> Show Dependencies

然后打开依赖的图, 看到依赖关系之后,

ctrl+f 在弹出框Diagram Elements 找到 log4j-over-slf4j 点进去:

右键 -> Exclude 即可。

最终在pom.xml文件里自动生成排除我们在界面exclude的依赖。

重新打包项目,发布war包到tomcat,能正常启动,访问。

问题解决。

Tomcat启动堆栈异常的更多相关文章

  1. tomcat启动出现异常 Error filterStart

    tomcat启动中出现 Error filterStart异常, 没有任何堆栈信息,如下: SEVERE: Error filterStart Jul 6, 2012 3:39:05 PM org.a ...

  2. tomcat启动报异常(一)

    异常问题:Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web ...

  3. Tomcat 启动过滤器异常

    严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常 ja ...

  4. tomcat 启动 证书异常java.io.IOException: Alias name [cas] does not identify a key entry

    在搭建CAS server的过程中,Tomcat开启https,配置秘钥证书,证书是通过keytool生成的 <Connector port=" protocol="org. ...

  5. Tomcat启动之异常java.lang.IllegalStateException

    严重: Exception sending context destroyed event to listener instance of class org.springframework.web. ...

  6. 用普通用户通过sudo进行启动tomcat时报如下异常

    用普通用户通过sudo进行启动tomcat时报如下异常 tomcat user 不在 sudoers 文件中.此事将被报告. 这是由于sudo命令使用root用户执行命令.而处于安全性的考虑,一般不允 ...

  7. Tomcat启动load action异常

    近期将之前的项目移到另一个文件夹中(包的路径也更改了),启动Tomcat之后包错:无法加载action,看错误提示知道是路径错误,网上也有各种各样的解决方案,这里我的错误是因为项目移到了别的文件中,所 ...

  8. IDEA tomcat启动异常 org.apache.catalina.startup.ContextConfig parseWebXml

    启动Tomcat发现有异常,总是无法启动,具体的异常日志为下图 具体的解决方法为:在tomcat的conf/content.xml中加上<Loader delegate="true&q ...

  9. tomcat 启动异常 EOFException: Unexpected end of ZLIB input stream

    EVERE: Exception fixing docBase for context [/agdis] java.io .EOFException: Unexpected end of ZLIB i ...

随机推荐

  1. 解决docx4j 变量替换 由于变量存在样式式或空白字符 导致替换失败问题

    参考文章:https://blog.csdn.net/qq_35598240/article/details/84439929 使用docx4j进行变量替换时 变量(形如:${变量})必须是无格式的, ...

  2. C# 取得某月的最后一天和第一天

    strDate="2019-03" DateTime Date = DateTime.Parse(strDate); //要取得月份的某一天第一天).Date.AddDays( - ...

  3. C# 语音技术

    1.使用DotNetSpeech.dll. /// <summary> /// 朗读/// </summary>/// <param name="text&qu ...

  4. redis-cli中文乱码

    在开发过程中,需要验证redis缓存中的数据,发现redis存储的中文全是乱码,因为默认情况下redis不转义中文.如果在平常开发中想要看到中文内容,可以在使用redis-cli 命令登陆redis服 ...

  5. 使用MAT 分析内存泄漏实战

    在分析前可以阅读下这篇文章,很多内容就都知道了https://www.jianshu.com/p/738b4f3bc44b,下面我来分析上一篇文章内存泄漏的为问题 1.上一篇中已经生成了hprf的文件 ...

  6. redis启动警告解决

    vim /etc/rc.localecho never > /sys/kernel/mm/transparent_hugepage/enabled加入上面那句到/etc/rc.local,开机启 ...

  7. Navicat连接Mysql8.0.11出现1251错误

    # 登录mysql mysql -u root -p # 修改加密规则 mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_pas ...

  8. thinkphp3.2.2公用函数

    thinkphp3.2.2公用函数函数调用默认路径 home/Common/function.php

  9. SQL Server 从Excel导入到数据库操作遇到的科学计数法问题

    问题描述 今天在做从Excel导入数据到SQL Server 中将数据更新到表中,可惜就这一个简单的操作中出现了一点小插曲,就在我根据Excel中的编号关联表编号以此更新姓名字段时出现转换错误问题.如 ...

  10. asp.net中的html標籤runat=server時的映射

    asp.net中的html控制項runat=server時的映射 1.標準xhtml標籤:http://blog.csdn.net/TangZhongxin/archive/2009/07/31/43 ...