maven项目导入spring相关jar包版本兼容问题
启动出现的异常如下:
十一月 02, 2018 10:56:12 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:ressm’ did not find a matching property.
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.53
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Jun 29 2018 14:42:45 UTC
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.53.0
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 8.1
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.3
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: D:\Java\jdk1.8.0_72\jre
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_72-b15
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\MyAssistant\apache-tomcat-8.0.53
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\MyAssistant\apache-tomcat-8.0.53
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\MyAssistant\apache-tomcat-8.0.53
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\MyAssistant\apache-tomcat-8.0.53
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\MyAssistant\apache-tomcat-8.0.53\wtpwebapps
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\MyAssistant\apache-tomcat-8.0.53\endorsed
十一月 02, 2018 10:56:12 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
十一月 02, 2018 10:56:12 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.2.16 using APR version 1.6.3.
十一月 02, 2018 10:56:12 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
十一月 02, 2018 10:56:13 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.2m 2 Nov 2017)
十一月 02, 2018 10:56:13 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler [“http-apr-8080”]
十一月 02, 2018 10:56:14 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler [“ajp-apr-8009”]
十一月 02, 2018 10:56:14 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1832 ms
十一月 02, 2018 10:56:14 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十一月 02, 2018 10:56:14 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.53
十一月 02, 2018 10:56:14 上午 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[/ressm]]
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:945)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1410 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1410) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1410)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1400)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ressm]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
… 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@36118fe3]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5149)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 6 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@4ca608cf]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:135)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:722)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 9 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
… 12 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access 1400 ( Z i p F i l e . j a v a : 60 ) a t j a v a . u t i l . z i p . Z i p F i l e 1400(ZipFile.java:60) at java.util.zip.ZipFile 1400(ZipFile.java:60)atjava.util.zip.ZipFileZipFileInputStream.read(ZipFile.java:717)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readFully(IOUtils.java:65)
at java.util.jar.JarFile.getBytes(JarFile.java:425)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
… 13 more
十一月 02, 2018 10:56:14 上午 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:945)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:641)
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:349)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:483)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1410 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1410) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1410)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1400)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 6 more
十一月 02, 2018 10:56:14 上午 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[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.startup.Catalina.start(Catalina.java:641)
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:349)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:483)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
… 11 more
十一月 02, 2018 10:56:14 上午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler [“http-apr-8080”]
十一月 02, 2018 10:56:14 上午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler [“ajp-apr-8009”]
十一月 02, 2018 10:56:14 上午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
十一月 02, 2018 10:56:14 上午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler [“http-apr-8080”]
十一月 02, 2018 10:56:14 上午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler [“ajp-apr-8009”]
解决思路:
将maven中的pom.xml文件中的spring-aspects项目依赖包注释掉tomcat就可以启动了;
或者将spring相关的包版本换成较低的版本,用太新的版本容易导致不兼容问题。