现网环境业务不影响,但是tomcat启动一直有error日志,ERROR org.apache.catalina.startup.ContextConfig- Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/asm

时间:2022-02-27 22:49:58

  完整的错误日志信息:

2019-03-19 15:30:42,021 [main] INFO  org.apache.catalina.core.StandardEngine- Starting Servlet Engine: ONIP SOABean OpenAS V300R002C50SPC100
2019-03-19 15:30:43,029 [localhost-startStop-1] INFO  org.apache.catalina.loader.WebappClassLoader- validateJarFile(/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2019-03-19 15:30:43,565 [localhost-startStop-1] ERROR org.apache.catalina.startup.ContextConfig- Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/asm-7.0.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
        at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:133)
        at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:222)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2105)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1947)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1932)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1326)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.

  这个东西乍一看,我们这老司机都猜测两种情况:

  1、要么是jdk版本的问题;

  2、要么是jar包冲突了;

  那么现在开始探案,由于用的是tomcat的8.0版本的,以前一直是没有问题的,所以就把问题重心偏向了jar包冲突这个原因,看日志里面是有个asm-7.0.jar的jar包这里报了错,下面我们去依赖里面搜索下着jar包;

现网环境业务不影响,但是tomcat启动一直有error日志,ERROR org.apache.catalina.startup.ContextConfig- Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/asm

  发现这个jar包是由payment-api-1.2.146.jar这个jar包依赖进来的,看来真的是这个jar包导致的启动报错,我去代码里面看了下,确实没有地方依赖这个jar包,所以我这里把这个jar包的依赖给删除了,这样一了百了;

  还有另一种解决方法就是把这个依赖给排除了也行,由于payment-api依赖cglib,而cglib又依赖了asm,所以排除也是可以的;

  现网环境业务不影响,但是tomcat启动一直有error日志,ERROR org.apache.catalina.startup.ContextConfig- Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/asm

  然后我打包,丢到环境上,重新启动,发现启动正常了!