tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cohen <>
Subject HELP!!! java.lang.NoClassDefFoundError running CXF-based client in Tomcat
Date Wed, 26 Nov 2008 15:05:19 GMT
(Cross-posted on Apache CXF Mailing List)

I have developed a Client for accessing a vendor's Web Service.  The 
client is based on the CXF framework, built with source code generated 
from a Maven-based pom.xml and the vendor's WSDL.

I ran this client in a standalone JUnit test and found it to work.  
Being a curmudgeon who doesn't believe in including every jar under the 
sun and who likes to know why I'm including what I am including, I 
removed 14 of the 47 jars that Maven told me to include, but which 
seemed irrelevant to me, and it still ran.

The ultimate destination of this component is inside a web-app running 
under Tomcat 6.0.  When I put my component and the 33 necessary jars 
into WEB-INF/lib I got NoClassDefFoundErrors.  These errors are 
singularly uninformative, all I know is that the class supposedly not 
found is my client class, however, given the following code:

MyClient myclient1 = null;
MyClient myclient2 = new MyClient();

the error occurs on the second line and not the first.  Therefore I 
conclude that the NoClassDefFoundError refers to a dependency, and not 
to MyClient itself.  The NoClassDefFoundError itself is singularly 
uninformative - the getCause() member, for example, returns null.  I 
need more information and can't figure out where to find it.

I have since tried putting back all the fourteen other jars that Maven 
insisted I include and THIS DID NOT HELP.  I am beginning to think the 
problem is not a missing class but a class conflicting with something in 

How the HELL do I debug this, given the miserable lack of information in 
a NoClassDefFoundError?
I have tried putting a
switch on the jvm command line that launches Tomcat, and while this does 
emit a slew more information, it still doesn't tell me what I need.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message