tomcat server fails to start the server and application in STS [duplicate]
Asked Answered
D

7

19

When I run a Spring MVC application I get this exception and the sever fails to start.

Please help me to fix this issue.

Exception StackTrace:

Jan 24, 2013 11:33:59 AM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [org/springframework/instrument/classloading/oc4j/package-info.class] from Jar [jar:file:/D:/works/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/dailyship/WEB-INF/lib/spring-context-3.1.0.RELEASE.jar!/] for annotations
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:56)
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:677)
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:413)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
    at java.io.DataInputStream.readInt(DataInputStream.java:387)
    at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:237)
    at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:114)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2104)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1980)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1946)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1931)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1325)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Dodson answered 24/1, 2013 at 6:11 Comment(0)
K
32

The jar file may be corrupt as a result of bad internet connection. Try removing the content of your C:\Users\[username]\.m2\repository folder. Then right click your project, select Maven, Update Project, check on Force Update of Snapshots/Releases. If you are sure only one Jar file has a problem, then you only need to delete its folder.

Kristin answered 24/1, 2013 at 6:55 Comment(2)
Why can't the exception name which dependency has a problem? Why we have to clean the entire repo for one corrupt jar?Shirker
I have no idea what was causing the problems (what file exactly), but removing the maven folder and re-downloading dependencies / rebuilding them - helped...Increment
N
3

As newbie has mentioned to clean up local maven repository, you can do it by executing mvn dependency:purge-local-repository, which will delete the jars from local-repo and re-download them.

Nubbly answered 26/7, 2016 at 13:33 Comment(0)
W
3
  • close your IDE
  • delete the .jar file located in (workspace_folder_location)/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/dailyship/WEB-INF/lib/spring-context-3.1.0.RELEASE.jar
  • open your IDE

If you work with maven:

  • Right click on the project
  • Maven -> Update Project -> check Force Update of snapshot/Releases
Windowshop answered 7/8, 2016 at 8:26 Comment(1)
I think you should , rename the place where .metadata folder is located not D:/works ?Nika
U
1

In Mac OS. Navigate to ~/.m2/ and run rm -rf repository/

Then reimport all your maven dependencies.

Urethroscope answered 19/9, 2016 at 4:25 Comment(0)
C
1

I had same problem because of dependencies which are available in pom.xml file,some of them are corrupted.I resolve that by simply removing .m2/repository folder contents and followed this steps.

  1. Run as -> Maven clean.

  2. Run as -> Maven Install.(Use good internet provider)

  3. maven -> Update project.

It will help you too.

Certification answered 10/10, 2017 at 8:44 Comment(0)
H
0

This worked for me:

Delete all the files on your local repo directory that causes error. Do maven clean, maven install and re-deploy your files in server. That's it.

Helban answered 1/7, 2015 at 10:21 Comment(0)
R
0

The answers above do not helped me. But after restarting PC on which Spring MVC application was running and issue has disappeared. It can be helpful for those who will face with the same problem.

Rendezvous answered 23/10, 2017 at 11:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.