Failed to load servlet and NoClassDefFoundError occurs when executing an Axis Web Service on IBM WebSphere when the MCSServiceAgent is running
Technical Note USA11805Created 31-May-2005Applies To
myEXTRA! Smart Connectors for 3270 & 5250
WebSphere
Apache Axis
Symptoms
Failed to load servlet and NoClassDefFoundError occurs when executing an Axis Web Service on IBM WebSphere when the MCSServiceAgent is runningFailed to load servlet: java.lang.NoClassDefFoundError: org.apache.axis.transport.http.AxisServlet
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
at java.lang.Class.getConstructor0(Class.java:1762)
at java.lang.Class.newInstance0(Class.java:276)
at java.lang.Class.newInstance(Class.java:259)
at java.beans.Beans.instantiate(Beans.java:204)
at java.beans.Beans.instantiate(Beans.java:48)
at ...
Fix
The axis application is failing because WebSphere cannot load AxisServlet. The underlying cause has to do with JCL (Jakarta Commons Logging). The details of which are as follows...
When the class load sequence is altered, a modified JCL configuration may also be required for your Web Application; this appears to be the case with Apache axis. Specifically, if JCL is not configured correctly, you will encounter unexpected behaviors such as classloader errors.
This solution is to force the WAR classloaders to locate and load the application-specific LogFactory implementation, as opposed to the proprietary WebSphere implementation. This has certain benefits: assuming an application is packaged in this fashion, then all application-specific JCL artifacts will override those supplied with WebSphere. Also, the solution is guaranteed to affect only the application, not the application server nor its hosted applications; and third, it allows different versions of JCL to integrate on a per-application basis.
Solution: Upgrade to Axis v1.2.1
There is no known solution for Axis 1.2, where an Axis regression appears to have occurred.
Solution for Axis v1.1:
Proceed as follows to implement the apache-specific JCL package for your axis Web Application:
1.) Create a file named "commons-logging.properties" and enter the following line:
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
2.) Add the commons-logging.properties file to "...WEB-INF\lib\commons-logging.jar" file in the Web Application
3.) Apply the workaround for the MCSServiceAgent (see solution USA11385 for details).
4.) Restart WebSphere
Did this technical note answer your question?
Need further help? For technical support, please contact
Support.