运行Maven项目时出现invalid LOC header (bad signature)
为Maven小白,今天这问题困扰了我好久,经过多次在网上查询,终于找到了原因。明明一个小问题却耗费很多时间,着实不应该,所以必须记录一下。
报错信息如下:
对话框:
控制台:
- <span style="font-size:14px;"><span style="color:#ff0000;">严重: A child container failed during start
- java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvcController]]
- at java.util.concurrent.FutureTask.report(Unknown Source)
- at java.util.concurrent.FutureTask.get(Unknown Source)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
- at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- at java.util.concurrent.FutureTask.run(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
- at java.lang.Thread.run(Unknown Source)
- Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvcController]]
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
- ... 6 more
- Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@43cd5898]
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
- at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4909)
- at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5039)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- ... 6 more
- Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@4d31c0af]
- at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
- at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- ... 9 more
- Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
- at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96)
- 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(Unknown Source)
- at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
- at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
- at java.util.zip.InflaterInputStream.read(Unknown Source)
- at sun.misc.IOUtils.readFully(Unknown Source)
- at java.util.jar.JarFile.getBytes(Unknown Source)
- at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
- at java.util.jar.JarFile.getManifest(Unknown Source)
- at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:94)
- ... 13 more
- 十一月 29, 2016 2:54:19 下午 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(Unknown Source)
- at java.util.concurrent.FutureTask.get(Unknown Source)
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
- at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
- 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:1408)
- at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
- at java.util.concurrent.FutureTask.run(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
- at java.lang.Thread.run(Unknown Source)
- Caused by: org.apache.catalina.LifecycleException: A child container failed during start
- at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
- at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- ... 6 more
- 十一月 29, 2016 2:54:19 下午 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:154)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
- 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:769)
- 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:439)
- 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:924)
- at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
- at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- ... 11 more
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol pause
- 信息: Pausing ProtocolHandler ["http-nio-8080"]
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol pause
- 信息: Pausing ProtocolHandler ["ajp-nio-8009"]
- 十一月 29, 2016 2:54:19 下午 org.apache.catalina.core.StandardService stopInternal
- 信息: Stopping service Catalina
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol destroy
- 信息: Destroying ProtocolHandler ["http-nio-8080"]
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol destroy
- 严重: Failed to destroy end point associated with ProtocolHandler ["http-nio-8080"]
- java.lang.NullPointerException
- at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:305)
- at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:481)
- at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:823)
- at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:533)
- at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:588)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:859)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol destroy
- 信息: Destroying ProtocolHandler ["ajp-nio-8009"]
- 十一月 29, 2016 2:54:19 下午 org.apache.coyote.AbstractProtocol destroy
- 严重: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
- java.lang.NullPointerException
- at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:305)
- at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:481)
- at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:823)
- at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:533)
- at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:588)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:859)
- at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)
- at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
- at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)</span>
- </span>
原因:
提取错误的关键信息
说明Jar包出现了问题。
那么接下来就要找哪个jar包出现了问题:
方法1、可通过右击项目名 -> Run as -> Maven test ,这时控制台会报哪个jar包出错。 (也可以打开DOS命令窗口,切换至项目目录,运行mvn test命令,和Eclipse的控制台输出信息一致)
方法2、如果方法1未出现任何错误信息,那么就使用笨办法。打开项目中的pom.xml文件,在自己的Maven本地仓库去查找pom.xml文件中每一个dependency节点所对应的jar包版本。一个一个对比,看看是否都正常下载。
这里,我找到了本地仓库中出现的jar包错误:
解决方法:
既然jar包未下载成功,那么重新下载就行了。如果重新下载还是不能成功,那就在网上下载同版本的拷贝进去。
删除掉该jar包所在目录下的所有文件后,重新运行maven install。
这时,可看到jar包已正常下载。
再次运行项目,右击项目 -> Run as -> Run on server 。可以发现,项目能正常运行了。
运行Maven项目时出现invalid LOC header (bad signature)的更多相关文章
- 运行Maven项目时出现invalid LOC header (bad signature)错误,Tomcat不能正常启动
作为Maven小白,今天这问题困扰了我好久,经过多次在网上查询,终于找到了原因.明明一个小问题却耗费很多时间,着实不应该,所以必须记录一下. 报错信息如下: 对话框: 控制台: <span st ...
- [转]maven编译时出现读取XXX时出错invalid LOC header (bad signature)
maven编译时出现读取XXX时出错invalid LOC header (bad signature) 一.发现问题右击pom.xml,run as —> maven install,会看到c ...
- maven编译时出现读取XXX时出错invalid LOC header (bad signature)
问题原因 该包没有下载正确. 解决办法 找到该包的目录,删除该包重新下载即可. 重新下载后用maven test一下,红叉消失.
- 解决Maven打包提示:读取C:\Users\Administrator\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar时出错; invalid LOC header (bad signature)
1.打包情况 虽然提示读取jar包出错,但是还是能打包成功,在执行打的jar包时会报错,说找不到相关的类. 2.解决方案 从提示的路径可以找到对应的jar包,但为什么会读取错误呢?尝试着双击打开log ...
- Maven错误:XXX时出错; invalid LOC header (bad signature)的解决方法
错误原因是该包没下载成功,比如网络问题等因素. 解决方法:进入本地仓库删除该包,然后再执行打包或部署等操作即可.
- groovy-2.4.11.jar时出错; invalid LOC header (bad signature)
Information:java: Errors occurred while compiling module 'security'Information:javac 1.8.0_131 was u ...
- maven 错误:读取 xxx.jar 时出错;invalid LOC header (bad signature) 1 错误
reqHeader:{Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, Upgrade-Insecure- ...
- maven提示invalid LOC header (bad signature)的解决办法
今天执行mvn test的时候提示: 错误:读取 /home/subaochen/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.ja ...
- maven下载的jar文件出现invalid LOC header (bad signature)
有的时候maven下载了相对应的jar文件,但是某些类无法被引入,在eclipse打开该jar文件,发现相对应的类是invalid LOC header (bad signature),这时把mave ...
随机推荐
- protobuf 协议 windows 下 java 环境搭建
使用maven编译protobuf所需要的jar包 1. 安装配置maven (1)下载maven http://maven.apache.org/ 版本:apache-maven ...
- 创建一个包括菜单栏,工具栏,状态栏,文本编辑部件的经典GUI应用程序的骨架
效果如下: 代码如下: #!/usr/bin/python3 # -*- coding: utf-8 -*- """ This program creates a ske ...
- 小峰mybatis(3)mybatis分页和缓存
一.mybatis分页-逻辑分页和物理分页: 逻辑分页: mybatis内置的分页是逻辑分页:数据库里有100条数据,要每页显示10条,mybatis先把100条数据取出来,放到内存里,从内存里取10 ...
- python logging 日志模块的配置和使用
import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(line ...
- numpy的flat、flatten、ravel
import numpy as np dt = np.arange(10).reshape(5,2) # =============================================== ...
- java 总结代码块
判断str2在str中出现了多少次: //msg: // // 世界上最痛苦的事 莫过于有眼睛却发现不了美 有耳朵却不会欣赏音乐 有心灵却无法理解什么是最真 // 世界上最痛苦的事 莫过于错过了不该错 ...
- 普适注意力:用于机器翻译的2D卷积神经网络,显著优于编码器-解码器架构
现有的当前最佳机器翻译系统都是基于编码器-解码器架构的,二者都有注意力机制,但现有的注意力机制建模能力有限.本文提出了一种替代方法,这种方法依赖于跨越两个序列的单个 2D 卷积神经网络.该网络的每一层 ...
- 学习MongoDB 一:MongoDB 入门(安装与配置)
一.简介 MongoDB一种非关系型数据库(NoSql),是一种强大.灵活.可扩展的数据存储方式,因为MongoDB是文档模型,自由灵活很高,可以让你在开发过程中畅顺无比,对于大数据量.高并发.弱事务 ...
- Java反射机制 —— 简单了解
一.概述 JAVA反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法:对于任意一个对象,都能够调用它的任意一个方法和属性:这种动态获取的信息以及动态调用对象的方法的功能称为jav ...
- python函数进阶
知识内容: 1.函数即变量 2.嵌套函数 3.lambda表达式与匿名函数 4.递归函数 5.函数式编程简介 6.高阶函数与闭包 一.函数即变量 1.变量的本质 声明一个变量,在python里本质上讲 ...