升级log4j2,tomcat--7.0.16 启动就OOM,蛋疼的问题
来源:互联网 发布:国外域名需要备案吗 编辑:程序博客网 时间:2024/06/06 03:12
升级log4j2 ,官网说要web.xml里的<web-app> version 属性改成3.0,发现改了之后,一起动就报错OOM,
Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
发现改成2.5就没事:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
>
,或者加一个属性 metadata-complete=true 也没事:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
metadata-complete="true"
>
或者,换成 tomcat-7.0.81也没事,
真是日了狗了,这种问题网上没答案 只有靠自己研究了,折腾了好长时间
这个属性的作用如下:
Attribute : metadata-complete
The metadata-complete attribute defines whether this deployment descriptor and other related
deployment descriptors for this module (e.g., web service descriptors) are complete, or whether the
class files available to this module and packaged with this application should be examined for
annotations that specify deployment information. If metadata-complete is set to "true", the
deployment tool must ignore any annotations that specify deployment information, which might be
present in the class files of the application. If metadata-complete is not specified or is set to "false",
the deployment tool must examine the class files of the application for annotations, as specified by
the specifications.
猜测 是 2.5 没有采用java注解配置servlet,listener,filter....的特性,tomcat--7.0.16不会扫描java类的class,version=3.0 加上一个metadata-complete=true 属性也能阻止扫描
改成3.0 tomcat--7.0.16就会去扫描这些有servlet注解的 class,可能在这个过程中导致了OOM
而 tomcat--7.0.81 可能修复了这个问题
好复杂。。。。。。。。。。。。。。。。。
- 升级log4j2,tomcat--7.0.16 启动就OOM,蛋疼的问题
- 在DOS下启动tomcat可能遇到的问题--窗口闪一下就关闭
- 迅速解决resin或者tomcat启动闪一下就消失的问题
- myeclipse里面tomcat无法启动,运行就挂起的问题及解决
- Tomcat的启动的问题
- log4j2 升级问题 (包含log4j与slf4j版本)
- tomcat版本升级带来的编码问题
- tomcat无法启动的问题。
- Tomcat 启动两次的问题
- tomcat启动慢的问题
- Tomcat 启动两次的问题
- Tomcat启动失败的问题
- tomcat启动两次的问题
- Tomcat启动不了的问题
- linux 启动tomcat的问题
- tomcat无法启动的问题
- tomcat启动慢的问题
- OOM的问题
- kotlin学习day6:集合和操作符
- 开发单页应用(SPA)时候遇到的微信支付授权目录的坑
- Atitit 人脸识别 眼睛形态 attilax总结
- MySQL innodb 索引 B+树实现
- java 图形用户界面 之 在界面中添加滑动块 示例代码 及 相关知识点
- 升级log4j2,tomcat--7.0.16 启动就OOM,蛋疼的问题
- java 图形用户界面设计 之 在界面中添加菜单栏 示例程序及相关方法介绍
- windows上配置eclipse
- 百度云的高速下载技巧系列2---多线程文件下载工具idm v6.28.1绿色免注册版(PC)
- Hibernate入门学习笔记
- 配置Hibernate中的常见错误解决方案
- PAT 1082. Read Number in Chinese (25)
- 并发操作与数据的不一致性
- HIVE获取最新分区的数据的方法