Websphere 7 classloading delegation
Hi I'm trying to make axis2 work on Websphere 7, I did the sugested configuration in the apache axis site (changing the axis2.xml "EnableChildFirstClassLoading" parameter and change the classloader from "PARENT_FIST" to "PARENT_LAST" for the webmodule that contains axis2)
However inside the same EAR there is another web application with JSP and struts that after changing the classloader stops working (due to jar libraries version problems), my deployment.xml looks similar to this:
<?xml version="1.0" encoding="UTF-8"?> <appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1335990730424"> <deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1335990730424" startingWeight="10"> <modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1335990730424" startingWeight="10000" uri="StrutsWeb.war"/> <modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1335990730425" startingWeight="10000" uri="Axis2Web.war" classloaderMode="PARENT_LAST"/> <classloader xmi:id="Classloader_1335990730424" mode="PARENT_FIRST"/> </deployedObject> </appdeployment:Deployment>
Once I remove the "PARENT_LAST" from the axis2 web module the struts module starts working, with "PARENT_LAST" the web service works perfect but the struts web module doesn't. Seems like the classloader mode change is affecting both Web Modules.
Thanks in advance,
In WebSphere Application Server (like almost all application servers), there is a hierarchy of class loaders:
Application server class loaders | Includes WAS_HOME/plugins, WAS_HOME/lib, etc. | +-- Application class loader | Includes files in lib/ folder of the .ear | Includes all JARs referenced from Class-Path in all .war | +-- StrutsWeb.war class loader | Includes WEB-INF/classes and all JARs in WEB-INF/lib | +-- Axis2Web.war Includes WEB-INF/classes and all JARs in WEB-INF/lib
The <classloader> element in your config snippet is nested within ApplicationDeployment, so it corresponds to the application class loader. You probably don't want to modify this element, you probably want to modify the delegation mode of the individual WAR modules. However, if changing this setting is having an effect, then you probably have JARs on the application class loader class path that should actually be within the WEB-INF/lib of your WAR modules.