JAVA web 项目启动报 Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)

最近在网上下载了一个maven java Web 项目,在加载到tomcat中报如下错误:
错误1:
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
错误2:
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@5fe7167f]
错误3:
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@2e9744bd]

等错误:如下图:

这里写图片描述

各种找错,找了好久好久,最终找到原因了。

将 pom.xml中的 jstl jar报更换

更换前:

这里写图片描述

更换后:

这里写图片描述

重启tomcat 服务

如下图:

这里写图片描述

至此,问题解决。
希望大家遇到类似问题也可以速度解决。毕竟项目开发时间很紧张。。

完!

阅读更多
换一批

invalid LOC header (bad signature) 求解决

12-17

严重: Unable to process Jar entry [com/google/common/collect/Iterators$6.class] from Jar [jar:file:/C:/Users/Administrator/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Demo1/WEB-INF/lib/guava-15.0.jar!/] for annotationsnjava.util.zip.ZipException: invalid LOC header (bad signature)n at java.util.zip.ZipFile.read(Native Method)n at java.util.zip.ZipFile.access$1400(ZipFile.java:60)n at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)n at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)n at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)n at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)n at java.io.BufferedInputStream.read(BufferedInputStream.java:265)n at java.io.DataInputStream.readInt(DataInputStream.java:387)n at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:201)n at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:80)n at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2089)n at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1965)n at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1931)n at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1916)n at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330)n at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)n at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)n at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)n at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5405)n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)n at java.util.concurrent.FutureTask.run(FutureTask.java:266)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)n at java.lang.Thread.run(Thread.java:745)n

maven项目启动tomcat:invalid LOC header (bad signature)

05-16

[code=text]rn五月 16, 2017 11:00:26 上午 org.apache.catalina.core.ContainerBase addChildInternalrn严重: ContainerBase.addChild: start: rnorg.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/OA]]rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1813)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@49a9683a]rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)rn at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4928)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn ... 10 morernCaused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@690ff5ab]rn at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)rn at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn ... 13 morernCaused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)rn at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96)rn at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)rn ... 16 morernCaused by: java.util.zip.ZipException: invalid LOC header (bad signature)rn at java.util.zip.ZipFile.read(Native Method)rn at java.util.zip.ZipFile.access$1400(ZipFile.java:60)rn at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)rn at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)rn at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)rn at sun.misc.IOUtils.readFully(IOUtils.java:65)rn at java.util.jar.JarFile.getBytes(JarFile.java:425)rn at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)rn at java.util.jar.JarFile.getManifest(JarFile.java:180)rn at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:94)rn ... 17 morern五月 16, 2017 11:00:26 上午 org.apache.catalina.startup.HostConfig deployDirectoryrn严重: Error deploying web application directory E:\Program_Files\Java\apache-tomcat-8.0.30\webapps\OArnjava.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/OA]]rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1813)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at java.lang.Thread.run(Thread.java:745)rn五月 16, 2017 11:00:26 上午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deployment of web application directory E:\Program_Files\Java\apache-tomcat-8.0.30\webapps\OA has finished in 36 msrn五月 16, 2017 11:00:26 上午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory E:\Program_Files\Java\apache-tomcat-8.0.30\webapps\ROOTrn五月 16, 2017 11:00:26 上午 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deployment of web application directory E:\Program_Files\Java\apache-tomcat-8.0.30\webapps\ROOT has finished in 27 msrn五月 16, 2017 11:00:26 上午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["http-nio-8080"]rn五月 16, 2017 11:00:26 上午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["ajp-nio-8009"]rn五月 16, 2017 11:00:26 上午 org.apache.catalina.startup.Catalina startrn信息: Server startup in 943 msrn[/code]

java.util.zip.ZipException: invalid LOC header (bad signature搞得我头痛啊,求大仙救我

09-05

rn九月 05, 2013 7:13:06 下午 org.apache.catalina.startup.TldConfig tldScanJarrnSEVERE: Exception processing TLD META-INF/tlds/struts-tiles.tld in JAR at resource path E:\workspaces\workspace01\firstproject\target\firstproject-0.0.1-SNAPSHOT\WEB-INF\lib\struts-1.2.9.jar in context /firstprojectrnjava.util.zip.ZipException: invalid LOC header (bad signature)rn at java.util.zip.ZipFile.read(Native Method)rn at java.util.zip.ZipFile.access$1400(ZipFile.java:56)rn at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:677)rn at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:413)rn at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)rn at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:122)rn at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2872)rn at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:659)rn at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:799)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)rn at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)rn at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)rn at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:401)rn at org.apache.catalina.startup.TldConfig.tldScanJar(TldConfig.java:363)rn at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:275)rn at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:636)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4612)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rn

没有更多推荐了,返回首页