Trying to solve Tomcat error: java.lang.NoClassDefFoundError: org/apache/naming/TransactionRef

I got this error below when starting Tomcat.
I google and found that it means I'm missing naming-factory.jar.
But actually I do have it in common/lib.

Can someone please advise?

Thanks in advance for the help.
Nov 18, 2008 1:24:15 PM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: org/apache/naming/TransactionRef
        at org.apache.catalina.core.StandardServer.<init>(
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.lang.reflect.Constructor.newInstance(
        at java.lang.Class.newInstance0(
        at java.lang.Class.newInstance(
        at org.apache.tomcat.util.digester.ObjectCreateRule.begin(
        at org.apache.tomcat.util.digester.Rule.begin(
        at org.apache.tomcat.util.digester.Digester.startElement(
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.tomcat.util.digester.Digester.parse(
        at org.apache.catalina.startup.Catalina.load(
        at org.apache.catalina.startup.Catalina.load(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rnicholusAuthor Commented:
I think this starts the problem.

There was this symbolic link inside /common/lib:
naming-factory.jar --> /usr/local/ .....

Then I accidentally added naming-factory.jar (the actual file) into that directory.
I remove this file and then the error starts happening eventhough the naming-factory.jar symbolic link is still there.
In Tomcat 6 it's in catalina.jar, which is in the lib directory
rnicholusAuthor Commented:
It's tomcat5.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

rnicholusAuthor Commented:
Is it possible that whatever in that directory is now corrupted?
Download the jar from 

and execute it thus

java -jar jarsearch.jar $CATALINA_HOME TransactionRef

Open in new window

rnicholusAuthor Commented:

I downloaded Tomcat 5 package again and reimport whatever in the /lib directory.
Now Tomcat works ok again.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OK - good
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.