java.util.zip.ZipException: invalid LOC header (bad signature)

1:部署好项目,启动tomcat出现如下所示的错误,百度方法,挺多的,但是好像并没有解决我的问题,问题如下所示:

 1 java.util.zip.ZipException: invalid LOC header (bad signature)
 2     at java.util.zip.ZipFile.read(Native Method)
 3     at java.util.zip.ZipFile.access$1400(Unknown Source)
 4     at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
 5     at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
 6     at java.util.zip.InflaterInputStream.read(Unknown Source)
 7     at org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3521)
 8     at org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1458)
 9     at org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1686)
10     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2272)
11     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
12     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2280)
13     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
14     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2280)
15     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
16     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2280)
17     at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
18     at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2168)
19     at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120)
20     at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
21     at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942)
22     at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927)
23     at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332)
24     at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
25     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
26     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
27     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
28     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
29     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
30     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
31     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
32     at java.util.concurrent.FutureTask.run(Unknown Source)
33     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
34     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
35     at java.lang.Thread.run(Unknown Source)
36
37 二月 18, 2018 5:26:40 下午 org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
38 严重: Resource read error: Could not load junit/framework/TestCase.class.

2:解决方法如下所示,以及问题分析:

原因如下所示,出现如下所示,是因为下载没有下载完整。所以删除了这个包,从新使用maven下载即可:

使用如下所示maven工具进行下载即可:

然后使用toncat启动项目即可;主要分析是那个包出现来下载异常,然后解决即可;

原文地址:https://www.cnblogs.com/biehongli/p/8452956.html

时间: 2024-10-07 22:59:13

java.util.zip.ZipException: invalid LOC header (bad signature)的相关文章

启动TOMCAT报错 java.util.zip.ZipException: invalid LOC header (bad signature)

报错信息大致如下所示: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303) at org.apache.catalina.startup.Bootstrap.main(Bootstr

invalid LOC header (bad signature)错误与 java.lang.ClassFormatError: com/mysql/jdbc错误

1,报错信息如下: SEVERE: Resource read error: Could not load org.springframework.jmx.support.MetricType. java.util.zip.ZipException: invalid LOC header (bad signature) <span style="white-space:pre"> </span>at java.util.zip.ZipFile.read(Nati

java.util.zip.DataFormatException: invalid distance too far back

解压 war/jar文件时出现以下错误: java.util.zip.ZipException: invalid distance too far back at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.readFromInflater(ZipArchiveInputStream.java:478) at org.apache.commons.compress.archivers.zip.ZipArchive

java.util.zip.ZipException: error in opening zip file

今天项目升级,出现了很奇葩的问题.在本地和测试环境测试好好的,将项目打包成war(每次都这样打包)然后上传到阿里云服务器,启动tomcat一直报如下错误: java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:220) at java.util.zip.ZipFi

[java ] java.util.zip.ZipException: error in opening zip file

严重: Failed to processes JAR found at URL [jar:file:/D:/tools/apache-tomcat-7.0.64_2/webapps/bbs/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar!/] for static resources to be included in context with name [jar:file:/D:/tools/apache-tomcat-7.0.64_2/webap

我的Android进阶之旅------&amp;gt;Android编译错误java.util.zip.ZipException: duplicate entry的解决方法

今天在Android Studio中把另外一个项目引入当前项目,编译的时候出现了java.util.zip.ZipException: duplicate entry错误. 错误例如以下所看到的: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':watch:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipEx

java.util.zip.ZipException: duplicate entry(重复依赖多版本的类库)

同步SVN仓库中的代码,更新后,运行项目,出现如下错误: com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: uk/co/senab/photoview/BuildConfig.class 1 2 3 以上大概意思:重复依赖,重复了条目. 找到原因,对症下药.想想应该不难哦,减少重复依赖的库貌似可以搞定了. 1.在Gradle中, 删除photoview的

tomcat 启动时报java.util.zip.ZipException: error in opening zip file

项目运行部署tomcat中,一运行报java.util.zip.ZipException: error in opening zip file,其实tomcat有说明错误文件的位置,打开后发现在tomcat的webapps下面有个其它的项目,项目中的class文件下的lib中的有些jar发现是损坏的,删除掉就好了, 有些人说这个问题是maven导包问题,但我这个项目不是maven项目 原文地址:https://www.cnblogs.com/chenweng/p/8487248.html

java.util.zip.ZipException: duplicate entry: com/tencent/mm/a/a.class

这个问题吊不起微信支付,最终发现是后台接口给我传的appid不正确,传成另一个app的id了 错误日志: FAILURE: Build failed with an exception. * What went wrong:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformException: java.util.zi