升级log4j2,tomcat

  • 时间:
  • 浏览:0

Exception in thread "main" 

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

而 tomcat--7.0.81 机会修复了你这个问題图片

猜测 是 2.5 这么 采用java注解配置servlet,listener,filter....的价值形式,tomcat--7.0.16不要扫描java类的class,version=3.0 加进另有有一个metadata-complete=true  属性都可以阻止扫描

发现改成2.5就没事:

改成3.0  tomcat--7.0.16就会去扫描你这个有servlet注解的 class,机会在你这个过程中原因 了OOM

<web-app xmlns="http://java.sun.com/xml/ns/javaee"

  xmlns:xsi="http://www.w3.org/10001/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"

  >  

你造日了狗了,你这个问題图片网上没答案 不到靠我本人研究了,折腾了好长时间

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.

,机会加另有有一个属性  metadata-complete=true 也没事:

机会,加进 tomcat-7.0.81也没事,

  <web-app xmlns="http://java.sun.com/xml/ns/javaee"

  xmlns:xsi="http://www.w3.org/10001/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"

  >  

升级log4j2 ,官网说要web.xml里的<web-app> version 属性改成3.0,发现改了事先 ,共同动就报错OOM,

你这个属性的作用如下:

好多样化。。。。。。。。。。。。。。。。。