运行Maven项目时出现invalid LOC header (bad signature)错误,Tomcat不能正常启动
作为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)错误,Tomcat不能正常启动的更多相关文章
- 运行Maven项目时出现invalid LOC header (bad signature)
为Maven小白,今天这问题困扰了我好久,经过多次在网上查询,终于找到了原因.明明一个小问题却耗费很多时间,着实不应该,所以必须记录一下. 报错信息如下: 对话框: 控制台: <span s ...
- [转]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 ...
随机推荐
- IO Redirect 与 Pipe
对于任何一个进程,在启动时,都会打开三个流:stdin(标准输入), stdout(标准输出), stderr(标准错误输出).Stdout,stderr是process与Display之间,stdi ...
- ELK收集tomcat访问日志并存取mysql数据库案例
这个案例中,tomcat产生的日志由filebeat收集,然后存取到redis中,再由logstash进行过滤清洗等操作,最后由elasticsearch存储索引并由kibana进行展示. 1.配置t ...
- Tomcat安装、配置和部署笔记
首先从Apache的官方网站(http://tomcat.apache.org/)下载Tomcat.有安装版和解压版两种,我个人喜欢用解压版. Tomcat安装(绿色版安装) 1.将下载的Tomcat ...
- Teradata 批量查找PI字段
select * from dbc.indicesv where indextype in ('P','Q');
- Linux之权限详解
如何知道你有什么权限 我能干什么?这是我最关心的问题! 切换到普通用户 [root@luffy-01 ~]# su - pizza [pizza@luffy-01 ~]$ ls /root ls: c ...
- 2.05-random-uesr-proxy
import urllib.request def proxy_user(): proxy_list = [ {"https":""}, # {"ht ...
- google colab 使用指南
重启colab !kill - - 输出ram信息 !cat /proc/meminfo 输出cpu信息 !cat /proc/cpuinfo 更改工作文件夹 一般,当你运行下面的命令: !ls 你会 ...
- [tool] google搜索的正确使用姿势(待补全)
第一,也是非常重要的前提,请一定要能FQ.如果这条没有解决,没有往下的必要 现在我假设你已经能FQ了,个人推荐使用搜索引擎的顺序: Google>微软bing国际搜索>百度 (百度总能给你 ...
- 【转】【fiddler】抓取https数据失败,全部显示“Tunnel to......443”
这个问题是昨天下午就一直存在的,知道今天上午才解决,很感谢“韬光养晦”. 问题描述: 按照网络上的教程,设置fiddler开启解密https的选项,同时fiddler的证书也是安装到系统中,但是抓取h ...
- 微信硬件平台(七)微信开发--如何存储并定时更新access_token
https://blog.csdn.net/sct_t/article/details/53002611 我们知道请求access_Token会返回这样一个json,包括access_token(凭证 ...