2013-01-23 172 views
0

這個bean的創作是日誌失敗春季

,這是我的XML文件中的條目..

<bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"> 
    <constructor-arg ref="marshaller"/> 
    <constructor-arg ref="marshaller"/> 
    </bean> 


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter#0' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter]: Constructor threw exception; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter.<init>(Lorg/springframework/oxm/Marshaller;Lorg/springframework/oxm/Unmarshaller;)V" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter, and the class loader (instance of java/net/URLClassLoader) for resolved class, org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter, have different Class objects for the type org/springframework/oxm/Marshaller used in the signature 
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) 
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) 
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) 
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) 
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) 
    at javax.servlet.GenericServlet.init(GenericServlet.java:241) 
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283) 
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) 
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) 
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64) 
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) 
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48) 
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539) 
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985) 
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959) 
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878) 
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) 
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) 
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482) 
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) 
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) 
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) 
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247) 
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) 
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) 
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) 
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) 
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205) 
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58) 
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) 
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) 
Caused By: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter]: Constructor threw exception; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter.<init>(Lorg/springframework/oxm/Marshaller;Lorg/springframework/oxm/Unmarshaller;)V" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter, and the class loader (instance of java/net/URLClassLoader) for resolved class, org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter, have different Class objects for the type org/springframework/oxm/Marshaller used in the signature 

幫我解決這個問題提前 謝謝..

回答

3

從錯誤消息看,它看起來像是「傳遞依賴」問題。用簡單的英語來說,可以把一個庫稱爲依賴項。傳遞依賴將是圖書館正在使用的圖書館來完成其工作。

當兩個庫期待某個公用庫的不同版本時,可能會出現問題。

此外,它可能是應用程序服務器提供此庫並使其對主類加載器可見。在這種情況下,您可能能夠找到有問題的jar,將其取出並使用應用服務器版本。嘗試取出spring-oxm jar並查看服務器是否提供了所需的類。

它可以幫助圖書館經理爲您設置所有的罐子。

+0

感謝您的回覆,但我的兩個類都在同一個罐子 – vinod

+0

感謝您的信息,我能解決我的問題:)通過將我的jar放在服務器庫文件夾 – vinod

+0

小心這種方法,@Vinod。特別是如果你覆蓋了一個已經存在的jar,你可能會影響你不想在服務器本身做的事情。即使不是這樣,你只是在全球範圍內爲所有應用程序提供了一個jar,並且可能比任何部署有單獨應用程序的優先級更高(不知道WebLogic自己,我不能肯定地說)。 – dbreaux

相關問題