idea开发工具 用svn导入项目后启动comcat报错(已经摸索两天,感觉要被开了。。。)

来源:5-3 idea项目开发工具安装实操(mac)

qq_墓碣_0

2018-04-04

老师您好,十万火急!!!我用公司的svn地址检出项目后 启动comcat报错,错误内容(避免报错信息太乱,我简略了)如下:

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

  2. Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)

  3. Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@768fa895]

  4. Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@12961ef0]

已经摸索两天,网上的解答众说纷纭:

web.xml配置有误  没用找到对应的mapping(公司另一个同事可以成功部署访问,故应该不是)

在做成war包时 依赖jar包丢失 (有可能,我跟着网上做了相关操作还是报错)

http://img.mukewang.com/szimg/5ac4b7230001945a22661466.jpg

pom.xml  依赖冲突(应该不会,第一 同事正常部署了,第二 我用了idea自带的依赖分析图显示没有冲突)

http://img.mukewang.com/szimg/5ac4b7d90001a34c11861372.jpg

本人小白,才上班几天了,还没把这个“简单的问题”解决,感觉要被开了,求老师救命。。。。。十万火急!!!

写回答

6回答

Geely

2018-04-07


Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)

at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)

[2018-04-06 05:54:20,641] Artifact ciotems:war: Error during artifact deployment. See server log for details.

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

... 48 more

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



看异常,这里应该是关键异常,是否项目有启动的时候读取一些压缩文件,或者压缩等操作,检查一下LOC header这个异常看看。

0
1
qq_墓碣_0
非常感谢!我在网上看了大量关于此异常的资料,原来是因为maven未部署web-inf下lib文件中中的jar包,在pom中增加一个maven插件就解决了!!!太谢谢老师的提醒了,主要是报错信息太多,我其实不太知道看哪个。。。
2018-04-07
共1条回复

Geely

2018-04-07

@qq_墓碣_0  不用客气,主要是要学会找到关键异常哟~~同学解决了就好,什么时候有时间课程也求个10分好评呀,谢谢啦哈

1
0

polo哦

2018-04-04

其实可以选择本地svn下载项目,然后idea进行open项目

1
0

qq_墓碣_0

提问者

2018-04-06

老师您好,具体报错如下:

[2018-04-06 05:54:19,858] Artifact ciotems:war: Artifact is being deployed, please wait...

06-Apr-2018 17:54:20.630 严重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 

 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ciotems]]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)

at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1730)

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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484)

at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433)

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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)

at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)

at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)

at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)

at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)

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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361)

at sun.rmi.transport.Transport$1.run(Transport.java:200)

at sun.rmi.transport.Transport$1.run(Transport.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:196)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1bbb0122]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4977)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5110)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

... 42 more

Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@676f6700]

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)

... 45 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)

[2018-04-06 05:54:20,641] Artifact ciotems:war: Error during artifact deployment. See server log for details.

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

... 48 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(ZipFile.java:60)

at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)

at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)

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)

... 49 more

-------------------------------------------------------------------------------------------------

tomcat可以启动并运行自己编写的helloworld项目

在此项目中的配置如下

//img.mukewang.com/szimg/5ac748d80001f87414941466.jpg

//img.mukewang.com/szimg/5ac748fa0001eead14801348.jpg

maven配置如下:

//img.mukewang.com/szimg/5ac749440001c7d911280246.jpg

//img.mukewang.com/szimg/5ac749d50001fed718120250.jpg

jdk配置如下(考虑到是否jdk与mvn的兼容问题,重新装了)

//img.mukewang.com/szimg/5ac74a2b00014f8609520158.jpg

并在idea中已配置

学生实在是行不到哪里会出错,但感觉可能是部署的jar位置不对造成的。

//img.mukewang.com/szimg/5ac74b360001212b23200746.jpg

//img.mukewang.com/szimg/5ac74b460001c43b23360752.jpg


0
0

Geely

2018-04-05

你好,同学 打开一个新项目这个要看你具体的更详细的错误。目前这个线索还不够。

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

Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)

Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@768fa895]

Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@12961ef0]



这个错误你先保证在idea里你的tomcat配置是OK的。


另外没你说的那么严重,因为我没有你的项目,也不知道你的jdk maven具体环境及版本号。

我建议你去看看你同事配置好的,看看他的怎么配置的,毕竟你们都有相同的环境。。。老师也是爱莫能助呀目前来看。。。


0
0

qq_墓碣_0

提问者

2018-04-05

仁兄说的对,我也试过用idea open同事拷给我的项目 还是无法解决问题。。。不过还是谢谢提醒

0
0

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程