Caused by: java.lang.SecurityException: SHA-256 digest error for org/eclipse/paho/client/mqttv3/pers

在通过Jenkins构建maven项目时,构建完成后,启动tomcat报错,百思不得其解。记一下处理方法,
日志如下:

十一月 08, 2018 8:49:19 下午 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.
十一月 08, 2018 8:49:19 下午 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
十一月 08, 2018 8:49:20 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
十一月 08, 2018 8:49:20 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-7021"]
十一月 08, 2018 8:49:20 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1109 ms
十一月 08, 2018 8:49:20 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十一月 08, 2018 8:49:20 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.52
十一月 08, 2018 8:49:20 下午 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\apache-tomcat-7.0.52\webapps\report\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
十一月 08, 2018 8:49:20 下午 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\apache-tomcat-7.0.52\webapps\report\WEB-INF\lib\servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
十一月 08, 2018 8:49:30 下午 org.apache.catalina.core.ContainerBase startInternal
严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	... 6 more
Caused by: java.lang.SecurityException: SHA-256 digest error for org/eclipse/paho/client/mqttv3/persist/MqttDefaultFilePersistence.class
	at sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:223)
	at java.util.jar.JarVerifier.processEntry(JarVerifier.java:243)
	at java.util.jar.JarVerifier.update(JarVerifier.java:230)
	at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:484)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
	at java.io.DataInputStream.readInt(DataInputStream.java:387)
	at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:236)
	at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:113)
	at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2055)
	at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1931)
	at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1897)
	at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1882)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1314)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:873)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 6 more

十一月 08, 2018 8:49:30 下午 org.apache.catalina.core.ContainerBase startInternal
严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 6 more

十一月 08, 2018 8:49:30 下午 org.apache.catalina.startup.Catalina start
严重: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[47021]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 11 more

十一月 08, 2018 8:49:30 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-apr-7021"]
十一月 08, 2018 8:49:30 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
十一月 08, 2018 8:49:30 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["http-apr-7021"]

解决办法的博文:(https://blog.csdn.net/kevinxxw/article/details/79658400)

打的jar包文件有加密,签名不合法。这是因为在使用Maven打包的时候导致某些包的重复引用,以至于打包之后的META-INF的目录下多出了一些*.SF,.DAS,.RSA文件所致。
在POM文件里加入一些配置,过滤掉这些文件即可:


        
            
                *:*
                
                    META-INF/*.SF
                    META-INF/*.DSA
                    META-INF/*.RSA
                
            
        
    
    --------------------- 
    作者:小kevin 
    来源:CSDN 
    原文:https://blog.csdn.net/kevinxxw/article/details/79658400 
    版权声明:本文为博主原创文章,转载请附上博文链接!

你可能感兴趣的:(maven构建问题)