0

My dynamic project is not able to start the tomcat server. It always gives the same pop-up saying failed to start the service. I use Apache Tomcat v 7.0.6 and jdk8 and eclipse 2019-09. Following is the error trace that I get.

Jan 06, 2020 6:26:16 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_231\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_231/bin/server;C:/Program Files/Java/jre1.8.0_231/bin;C:/Program Files/Java/jre1.8.0_231/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Webex\Webex\Applications;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_231\bin;C:\Users\RA20099451\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk1.8.0_231\bin;;D:\eclipse;;.
Jan 06, 2020 6:26:16 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DCxM' did not find a matching property.
Jan 06, 2020 6:26:17 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 06, 2020 6:26:17 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 06, 2020 6:26:17 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1497 ms
Jan 06, 2020 6:26:17 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 06, 2020 6:26:17 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Jan 06, 2020 6:26:22 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\eclipseNew\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DCxM\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 06, 2020 6:26:22 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\eclipseNew\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DCxM\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
java.lang.reflect.InvocationTargetException
    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:303)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Caused by: org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
    at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
    at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
    at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
    at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1906)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1853)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1844)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1756)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1234)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:874)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4881)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:750)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:600)
    ... 6 more 

Things to note :

  1. When I run Apache tomcat use executable file, http://localhost:8080 is working.

  2. I downloaded a sample dynamic project and its working fine i.e. tomcat server is starting perfectly.

Also, I tried reinstalling eclipse, jdk, tomcat, still same problem I have seen other questions and followed the solutions but none solved my problem.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
pikapi
  • 21
  • 1
  • 6
  • Most probably wrong version of the BCEL library, which does not support your Java version. See e.g. https://stackoverflow.com/a/23608847/3511123 – Jozef Chocholacek Jan 06 '20 at 14:28
  • 2
    Does this answer your question? [org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15](https://stackoverflow.com/questions/23541532/org-apache-tomcat-util-bcel-classfile-classformatexception-invalid-byte-tag-in) – Jozef Chocholacek Jan 06 '20 at 14:29
  • 1
    Tomcat 7.0.6 isn't even in the [archives](https://archive.apache.org/dist/tomcat/tomcat-7/), but must be from before March 2011. Why on earth would you hunt issues in 9 year old software, when an updated version of (even) the same branch is available from last month (7.0.99, December 2019). And reading the links that @JozefChocholacek posted, that seems to be precisely your problem. Back in 2011, Java 8 wasn't released, so nobody ever tested the version you're using on the runtime you're using. – Olaf Kock Jan 06 '20 at 14:43
  • correction: it _is_ in the archives, _alphanumerically_ sorted m(. But that doesn't change anything: Released in January 2011. Use the current version! – Olaf Kock Jan 06 '20 at 14:50

0 Answers0