java.lang.ClassNotFoundException: org.apache.catalina.core.ThreadLocalLeakPreventionListener
Asked Answered
A

4

10

I'm trying to create a web service and deply it on Tomcat. I'm following this tutorial.

I'm using Eclipse Europa.

But when I try to start the server it returns this error:

java.lang.ClassNotFoundException: org.apache.catalina.core.ThreadLocalLeakPreventionListener
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
    at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
    at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1356)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:430)
Abstention answered 2/7, 2011 at 22:32 Comment(0)
V
15

The ThreadLocalLeakPreventionListener was added recently to tomcat. It is available in tomcat 7 as well as the latest version(s) of tomcat 6. Make sure you have the latest tomcat 6, with a clean installation (your installation might have the server.xml from the new version and the jars from the older one)

Visitant answered 2/7, 2011 at 22:49 Comment(3)
I can't see this class in Tomcat 6.0.35 (the latest 6). It is present in 7 though.Levine
Not in 6.0.45 either.Homs
Didn't work for me. Those options were disabled. So I removed the server from the Server tab and add again with the New Server Wizard and it worked. :)Transversal
B
1

even i faced the same issue.What you need to do is, go to servers tab and left click on Apache server and click on properties. There you can see Location pointing to [workspace metadata]. Click on switch Location. It will switch to Apache location /Servers/Tomcat xxx.Apply the changes and save.

Byyourleave answered 8/2, 2016 at 7:45 Comment(0)
V
1

If you are using the class in server.xml you need to remove it to get rid of the error/Exception.

<Listener 
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
Vampire answered 11/10, 2017 at 0:37 Comment(0)
S
0

Your web.xml contains entry for a listener whose code was added in Tomcat 7.0.6 and onwards, but your tomcat is older than that -

org.apache.catalina.core.ThreadLocalLeakPreventionListener

Seasoning answered 17/9, 2013 at 16:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.