简体   繁体   中英

Need help on NoClassDefFound error

I'm working on a service to prepare spreadsheet for a report. I'm using jxl-2.4.2.jar to achieve this ( please note that I can't use the latest version due to compatibility constraints). When I execute the code locally on my eclipse it works fine. My eclipse has java 1.5.

When I deploy my code in my test environment, its giving NoClassdefFound error for jxl.* ( any classes in jxl ). My test environment has IBM's java 1.5. I believe it doesn't make any difference if I use IBM's version or Sun's version of java in this context.

I believe this error could happen when JVM fails to load the class at runtime or if the class has any static methods/properties. I checked the classes and none of them have static contents. So, this could be something else.

FYI.. I'm using ant to build the project & I check the build.xml. It is showing the correct version of java 1.5. Could someone please help to fix this error? Also Just FYI.. my project resides on AIX 5.0 server.

Any help in this regard much appreciated . Thanks in advance.

This error implies that your dependency is missing at runtime ie the set of dependent jars is not not correct. jxl-2.4.2.jar is not getting shipped along with deployment, so just to resolve the issue , you can manually copy this jar in dependent lib folder of deployment.

But proper fix will be to get your ANT build checked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM