【WebLogic异常处理】项目启动时抛出org.apache.cxf.wsn.client.Consumer异常处理

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1678

[backcolor=inherit]问题描述:
[backcolor=inherit] 项目部署到受管服务没有问题,但是在启动项目时抛出以下异常:

[backcolor=inherit][backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Root WebApplicationContext: initialization started
[backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Refreshing Root WebApplicationContext: startup date [Tue Oct 15 18:34:40 CST 2013]; root of context hierarchy
[backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Loading XML bean definitions from class path resource [applicationContext.xml]
[backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
[backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
[backcolor=inherit][INFO ] 2013-10-15 18:34:40 :Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml]
[backcolor=inherit][INFO ] 2013-10-15 18:34:41 :Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13541d7: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,*.http-destination,iSbuxarsService,sbuxarsServiceImpl]; root of factory hierarchy
[backcolor=inherit]Oct 15, 2013 6:34:42 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
[backcolor=inherit]INFO: Creating Service {[url]http://impl.zihexin.com/}SbuxarsServiceImplService from class com.zihexin.itf.ISbuxarsService
[backcolor=inherit]Oct 15, 2013 6:34:42 PM org.apache.cxf.endpoint.ServerImpl initDestination
[backcolor=inherit]INFO: Setting the server's publish address to be /sbuxarsWebService
[backcolor=inherit][INFO ] 2013-10-15 18:34:42 :Root WebApplicationContext: initialization completed in 2306 ms
[backcolor=inherit]com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsn.client.Consumer': Instantiation of bean failed; nested exception is com.bea.core.repackaged.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsn.client.Consumer]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.apache.cxf.wsn.client.Consumer.()
[backcolor=inherit]
[backcolor=inherit][INFO ] 2013-10-15 18:34:43 :Closing Root WebApplicationContext: startup date [Tue Oct 15 18:34:40 CST 2013]; root of context hierarchy
[backcolor=inherit][INFO ] 2013-10-15 18:34:43 :Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13541d7: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,*.http-destination,iSbuxarsService,sbuxarsServiceImpl]; root of factory hierarchy
[backcolor=inherit] (StubLifecycleHelper.java:48)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
[backcolor=inherit][backcolor=inherit] at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
[backcolor=inherit][backcolor=inherit] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
[backcolor=inherit][backcolor=inherit] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
[backcolor=inherit][backcolor=inherit] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
[backcolor=inherit][backcolor=inherit] at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:140)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
[backcolor=inherit][backcolor=inherit] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
[backcolor=inherit][backcolor=inherit] at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
[backcolor=inherit][backcolor=inherit] at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
[backcolor=inherit][backcolor=inherit] at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
[backcolor=inherit]Caused by: javax.xml.ws.WebServiceException: java.lang.InstantiationException: org.apache.cxf.wsn.client.Consumer
[backcolor=inherit][backcolor=inherit] at weblogic.wsee.jaxws.WLSServletInstanceResolver.create(WLSServletInstanceResolver.java:37)
[backcolor=inherit][backcolor=inherit] at weblogic.wsee.jaxws.WLSInstanceResolver.getSingleton(WLSInstanceResolver.java:34)
[backcolor=inherit][backcolor=inherit] ... 51 more
[backcolor=inherit]Caused by: java.lang.InstantiationException: org.apache.cxf.wsn.client.Consumer
[backcolor=inherit][backcolor=inherit] at java.lang.Class.newInstance0(Class.java:340)
[backcolor=inherit][backcolor=inherit] at java.lang.Class.newInstance(Class.java:308)
[backcolor=inherit][backcolor=inherit] at weblogic.wsee.jaxws.injection.WSEEComponentContributor.newInstance(WSEEComponentContributor.java:54)
[backcolor=inherit][backcolor=inherit] at weblogic.wsee.jaxws.injection.WSEEComponentContributor.newInstance(WSEEComponentContributor.java:42)
[backcolor=inherit][backcolor=inherit] at weblogic.wsee.jaxws.WLSServletInstanceResolver.create(WLSServletInstanceResolver.java:35)
[backcolor=inherit][backcolor=inherit] ... 52 more

[backcolor=inherit]异常分析:
[backcolor=inherit] Weblogic是10.3.5_x86版本,JDK是1.6.0_24_x86版本。初步怀疑类加载冲突,[font=Arial, Helvetica, FreeSans, sans-serif][backcolor=inherit][backcolor=inherit]项目中的CXF包与Weblogic中的包冲突。所以调整weblogic.xml,加入标红部分信息。
[backcolor=inherit][backcolor=inherit]
[backcolor=inherit]
[backcolor=inherit] /
[backcolor=inherit]
[backcolor=inherit] true
[backcolor=inherit] true
[backcolor=inherit]

[backcolor=inherit]
[backcolor=inherit]
[backcolor=inherit] /*
[backcolor=inherit] GBK
[backcolor=inherit]

[backcolor=inherit]

[backcolor=inherit][backcolor=inherit]
[backcolor=inherit][backcolor=inherit]
[backcolor=inherit][backcolor=inherit] javax.jws.*
[backcolor=inherit][backcolor=inherit] org.apache.*
[backcolor=inherit][backcolor=inherit] antlr.*
[backcolor=inherit][backcolor=inherit] org.apache.xml.security.*
[backcolor=inherit][backcolor=inherit] org.springframework.*
[backcolor=inherit][backcolor=inherit]

[backcolor=inherit][backcolor=inherit]

[backcolor=inherit]

[backcolor=inherit] 从新打包并部署项目,再次启动项目问题解决。

[backcolor=inherit]解决办法:
[backcolor=inherit] [backcolor=inherit][font=Arial, Helvetica, FreeSans, sans-serif]调整weblogic.xml,加入以下信息:
[backcolor=inherit][backcolor=inherit][backcolor=inherit]
[backcolor=inherit][backcolor=inherit]
[backcolor=inherit][backcolor=inherit] javax.jws.*
[backcolor=inherit][backcolor=inherit] org.apache.*
[backcolor=inherit][backcolor=inherit] antlr.*
[backcolor=inherit][backcolor=inherit] org.apache.xml.security.*
[backcolor=inherit][backcolor=inherit] org.springframework.*
[backcolor=inherit][backcolor=inherit]

[backcolor=inherit][backcolor=inherit]

[backcolor=inherit][backcolor=inherit]

[backcolor=inherit]总结:
[backcolor=inherit][backcolor=inherit] weblogic的类加载冲突是常见问题,可以通过调整[backcolor=inherit][font=Arial, Helvetica, FreeSans, sans-serif]weblogic.xml来指定类的加载顺序([backcolor=inherit]目前10.3.5和10.3.6可用,其他版本未测试)。

[backcolor=inherit]参考文档:
[backcolor=inherit][backcolor=inherit]https://cwiki.apache.org/confluence/display/CXF20DOC/Application+Server+Specific+Configuration+Guide

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】