JAVAC JAVAC - 1 month ago 17
Java Question

tomcat not starting up in eclipse, Logger ClassnotFoundException, invalid LOC header

Tomcat not starting up in eclipse, tomcat is up and running out of eclipse.

Tomcat 7.0.72, eclipse mars2, java 7 all are 64bit

2 different exceptions in logs


  1. ZipException for org.apche.commons.digester.Rule

  2. ClassNotFoundException for class org.apche.log4j.Logger




SEVERE: Resource read error: Could not load
org/apache/commons/digester/Rule.class. 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:679) at
java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:415)
at
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3512)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1458)
at
org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1686)
at
org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2272)
at
org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
at
org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2168)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942)
at
org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

Nov 01, 2016 10:33:42 AM
org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
SEVERE: Resource read error: Could not load
org/apache/commons/digester/AbstractObjectCreationFactory.class.
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:679) at
java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:415)
at
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3512)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1458)
at
org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1686)
at
org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2272)
at
org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
at
org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2168)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942)
at
org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)


2.


Caused by: java.lang.NoClassDefFoundError: LLogger; at
java.lang.Class.getDeclaredFields0(Native Method) at
java.lang.Class.privateGetDeclaredFields(Class.java:2397) at
java.lang.Class.getDeclaredFields(Class.java:1806) at
org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at
org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:89)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:63)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:891)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 6 more Caused by: java.lang.ClassNotFoundException: Logger at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)

Answer

after a lot of fight able to resolve the 2 issues 1. by upgrading the commons-digester from 1.6 to 2.1 2. by downgrading the version of log4j from 1.2.17 to 1.2.8

don't why eclipse with maven build tomcat 7.0.72 unable to recognize the logger version of 1.2.17 to org.apache.log4j.Logger class