You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by babloosony <ba...@gmail.com> on 2005/03/14 14:04:16 UTC

AXIS - Xerces Classloading Problems with WebSphere

Hi All,

I am trying to deploy Apache AXIS 1.2 RC2 as Web Module inside a EAR
deployed using WSAD 5.1.2's WebSphere 5.0  Test Environment.


Websphere 5.0 server has built with its own logging component
internally for its own logging purposes and has  been kept in Webphere
java runtime extension  folder. So whenever that logging component has
been called by default the logger and manager has  been loaded from
the extension class loader. We need to avoid this scenario for our own
applications  deployed on WAS 5.0 that use the same logging component
inside our EAR. Otherwise we could not  possible to load application
specific loggers' properties files. So in order to achieve this, the
ear file
class loading policy should be kept as PARENT_LAST. So the application
will able to locate and load our  logging component files from Shared
libraries then will try to load other classes from extension class
loader. Otherwise jlog framework
will not work. 

So the settings that work for our logging component and do not work
for AXIS Web Module integration into the same EAR are below:

a.ear Classloader mode: PARENT_LAST (must)
b.ear WAR classloader policy: APPLICATION
c.war Classloader mode : PARENT_LAST or PARENT_FIRST (can be anything)


WebSphere 5.0 exception stack trace
---------------------------------------------------------------------------------------------------
[3/14/05 17:58:53:199 IST] 4f58b287 WebGroup      I SRVE0180I:
[Apache-Axis] [/Axis12Rc2IrscWeb] [Servlet.LOG]: AdminServlet: init
[3/14/05 17:58:53:418 IST] 4f58b287 SystemOut     O - Exception:
java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
	at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
	at org.apache.axis.utils.XMLUtils.getDOMFactory(XMLUtils.java:200)
	at org.apache.axis.utils.XMLUtils.<clinit>(XMLUtils.java:83)
	at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:176)
	at org.apache.axis.AxisEngine.init(AxisEngine.java:162)
	at org.apache.axis.AxisEngine.<init>(AxisEngine.java:146)
	at org.apache.axis.server.AxisServer.<init>(AxisServer.java:87)
	at org.apache.axis.server.DefaultAxisServerFactory.createServer(DefaultAxisServerFactory.java:109)
	at org.apache.axis.server.DefaultAxisServerFactory.getServer(DefaultAxisServerFactory.java:73)
	at org.apache.axis.server.AxisServer.getServer(AxisServer.java:72)
	at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:183)
	at org.apache.axis.transport.http.AxisServletBase.getOption(AxisServletBase.java:370)
	at org.apache.axis.transport.http.AxisServletBase.init(AxisServletBase.java:110)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
	at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
	at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1270)
	at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:277)
	at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:396)
	at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:216)
	at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:984)
	at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
	at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:415)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:268)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:246)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
	at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
	at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
	at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)

[3/14/05 17:58:53:434 IST] 4f58b287 ServletInstan E SRVE0100E: Did not
realize  init() exception thrown by servlet AdminServlet:
javax.servlet.ServletException
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:99)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
	at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
	at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1270)
	at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:277)
	at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:396)
	at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:216)
	at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:984)
	at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
	at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:415)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:268)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:246)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
	at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
	at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
	at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
---- Begin backtrace for Nested Throwables
java.lang.ExceptionInInitializerError: java.lang.ClassCastException:
org.apache.xerces.jaxp.SAXParserFactoryImpl
	at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
	at org.apache.axis.utils.XMLUtils.initSAXFactory(XMLUtils.java:188)
	at org.apache.axis.utils.XMLUtils.<clinit>(XMLUtils.java:96)
	at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:176)
	at org.apache.axis.AxisEngine.init(AxisEngine.java:162)
	at org.apache.axis.AxisEngine.<init>(AxisEngine.java:146)
	at org.apache.axis.server.AxisServer.<init>(AxisServer.java:87)
	at org.apache.axis.server.DefaultAxisServerFactory.createServer(DefaultAxisServerFactory.java:109)
	at org.apache.axis.server.DefaultAxisServerFactory.getServer(DefaultAxisServerFactory.java:73)
	at org.apache.axis.server.AxisServer.getServer(AxisServer.java:72)
	at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:183)
	at org.apache.axis.transport.http.AxisServletBase.getOption(AxisServletBase.java:370)
	at org.apache.axis.transport.http.AxisServletBase.init(AxisServletBase.java:110)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
	at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
	at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1270)
	at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:277)
	at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:396)
	at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:216)
	at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:984)
	at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
	at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:415)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:268)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:246)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
	at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
	at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
	at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)


[3/14/05 17:58:53:606 IST] 4f58b287 WebGroup      E SRVE0020E:
[Servlet Error]-[AdminServlet]: Failed to load servlet:
java.lang.ExceptionInInitializerError: java.lang.ClassCastException:
org.apache.xerces.jaxp.SAXParserFactoryImpl
	at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
	at org.apache.axis.utils.XMLUtils.initSAXFactory(XMLUtils.java:188)
	at org.apache.axis.utils.XMLUtils.<clinit>(XMLUtils.java:96)
	at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:176)
	at org.apache.axis.AxisEngine.init(AxisEngine.java:162)
	at org.apache.axis.AxisEngine.<init>(AxisEngine.java:146)
	at org.apache.axis.server.AxisServer.<init>(AxisServer.java:87)
	at org.apache.axis.server.DefaultAxisServerFactory.createServer(DefaultAxisServerFactory.java:109)
	at org.apache.axis.server.DefaultAxisServerFactory.getServer(DefaultAxisServerFactory.java:73)
	at org.apache.axis.server.AxisServer.getServer(AxisServer.java:72)
	at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:183)
	at org.apache.axis.transport.http.AxisServletBase.getOption(AxisServletBase.java:370)
	at org.apache.axis.transport.http.AxisServletBase.init(AxisServletBase.java:110)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
	at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
	at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
	at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
	at javax.servlet.GenericServlet.init(GenericServlet.java:258)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
	at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
	at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1270)
	at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:277)
	at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:396)
	at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:216)
	at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:984)
	at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
	at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:415)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)
	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:268)
	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:246)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
	at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
	at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
	at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
	at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
	at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
	at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
---------------------------------------------------------------------------------------------------


One point to note is that the settings that do not work for our
logging component and work for  AXIS Web Module integration into the
same EAR  are below and I am not sure why these settings work:

a.ear Classloader mode: PARENT_FIRST (must)
b.ear WAR classloader policy: APPLICATION
c.war Classloader mode : PARENT_LAST or PARENT_FIRST (can be anything)


Now can anyone please tell me how do I avoid above errors.



Thanks & Regards,
Kumar.