Search code examples
javajakarta-eebusiness-objects

Webservice run time Exception error: java.lang.NoClassDefFoundError


After creating a web service for SAP BusinessObjects, at runtime I get an exception:

Exception: java.lang.NoClassDefFoundError: com/crystaldecisions/sdk/exception/SDKException; 
nested exception is: java.lang.NoClassDefFoundError: com/crystaldecisions/sdk/exception/SDKException
Message: java.lang.NoClassDefFoundError: com/crystaldecisions/sdk/exception/SDKException;
nested exception is: java.lang.NoClassDefFoundError: com/crystaldecisions/sdk/exception/SDKException

I have included all JAR files both in WEB-INF/lib, and as well I have referenced external JAR file in my project build path.

Can anyone help me solve this problem?

Thanks.


Solution

  • This error means that those files are not being found but are referenced from your code or even indirectly used by code you reference. You need to make sure that those exact classes are present in your JARs under WEB-INF/lib. My guess is that you have included the JAR files but have left couple of them out or have a wrong version of the JAR files in the WEB-INF/lib. For example you compile against a newer version but deploy with some older version.

    The trick I use to verify that is find . -iname "*jar" -exec unzip -t {} | vim -. This little line will show the file listing and I can search if those classes it is complaining about are actually present. If you want to use some other editor just pipe this to some file `find . -iname "*jar" -exec unzip -t {} > somefile.txt".