Axis2 Weblogic 10 jar conflict
I am trying to deploy a axis2 webservice client on Weblogic 10 server. However i get the below error :
java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136) at weblogic.servlet.internal.WebAppHelper$IOHelperImpl.parseXML(WebAppHelper.java:247) at weblogic.descriptor.DescriptorCache.parseXML(DescriptorCache.java:350) at weblogic.servlet.internal.WebAppHelper.parseTagLibraries(WebAppHelper.java:142) at weblogic.servlet.internal.WebAppHelper.(WebAppHelper.java:60) at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:402) at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:452) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:410) at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:582) at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:298) at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.f开发者_运维技巧low.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46) at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:189) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:719) at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1186) at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200) at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)cuteThread.run(ExecuteThread.java:172)
My weblogic-application.xml is as follows:
<wls:prefer-application-packages>
<wls:package-name>com.ctc.wstx.*</wls:package-name>
<wls:package-name>javax.xml.*</wls:package-name>
<wls:package-name>org.apache.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>
All help would be appreciated!
Fixed the issue: The weblogic-application.xml should be:
<wls:prefer-application-packages>
<wls:package-name>org.apache.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>
So that it picks up the weblogic stax-api implementation jar. Also there is no direct way to get weblogic stax parser to work with Axis2 1.5.2. So you need to have woodstock parser in the class path.
The issue is same with CXF. I tried all these approaches and ended up putting huge package list. Finally gave up as we decided to use Tomcat.
The above list given is only apache classes, you may have to add more packages for dependencies and beyond.
Refer: http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-WebLogic
精彩评论