ColdFusion MX 6.1: java.lang.NoClassDefFoundError when referring to class that relies on webservices.jar
Issue
Macromedia ColdFusion MX 6.1 J2EE configuration with JRun reports a NoClassDefFoundError when using cfobject to access a Java object that references classes in webservices.jar.
If you make a call using cfobject to a Java class that references a class in webservices.jar, the NoClassDefFoundError will be generated. The following is an example of a stack trace from the error:
java.lang.NoClassDefFoundError at org.apache.axis.client.Service.getAxisClient(Service.java:143) at org.apache.axis.client.Service.<init>(Service.java:152)
This issue is due to the existence of two webservices.jar files: one in the JRun directory structure and one in the CFusion WAR file. This confuses the class loader and causes the error.
Solution
Remove the webservices.jar from the ColdFusion WAR directory structure.
- Delete the webservices.jar file fromcf_root\WEB-INF\cfusion\lib.
For example:
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\lib - Restart ColdFusion.
Additional Information
Related TechNotes:
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
