问题描述
- weblogic环境下调用接口报错,急,在线等!org.w3c.dom.Node.setUserData
-
之前在测试环境中测试是可以的,后来部署到正式环境就挂掉了,tomcat下也是正常的。项目的weblogic.xml也配置了优先加载项目的jar包,还是不行。
ava.lang.LinkageError: loader constraint violation: when resolving interface method "org.w3c.dom.Node.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/cxf/staxutils/StaxUtils, and the class loader (instance of ) for resolved class, org/w3c/dom/Node, have different Class objects for the type erDataHandler;)Ljava/lang/Object; used in the signature
解决方案
[gjj-webapp] 2014-11-10 13:10:00 [ERROR] org.springframework.scheduling.support.MethodInvokingRunnable {68} - Invocation of method 'receiveOfficeSystemScheduing' on target class [class com.digipower.erms.gjj.scheduing.receive.impl.ReceiveScheduingServiceImpl] failed
java.lang.LinkageError: loader constraint violation: when resolving interface method "org.w3c.dom.Node.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/cxf/staxutils/StaxUtils, and the class loader (instance of ) for resolved class, org/w3c/dom/Node, have different Class objects for the type erDataHandler;)Ljava/lang/Object; used in the signature
at org.apache.cxf.staxutils.StaxUtils.addLocation(StaxUtils.java:951)
at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java:809)
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:878)
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:765)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:219)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:91)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:205)
at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:148)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
at javax.xml.ws.Service.(Service.java:36)
at com.ws.RisenetFiledataWSService.(RisenetFiledataWSService.java:54)
at com.digipower.erms.gjj.mgmt.receive.service.impl.OfficeSystemReceiveServiceImpl.processReceive(OfficeSystemReceiveServiceImpl.java:52)
at com.digipower.erms.gjj.mgmt.receive.service.impl.OfficeSystemReceiveServiceImpl$$FastClassByCGLIB$$792f763f.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.digipower.erms.gjj.mgmt.receive.service.impl.OfficeSystemReceiveServiceImpl$$EnhancerByCGLIB$$acbd0523.processReceive()
at com.digipower.erms.gjj.scheduing.receive.impl.ReceiveScheduingServiceImpl.receiveOfficeSystemScheduing(ReceiveScheduingServiceImpl.java:16)
at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
解决方案二:
同样遇到此问题,我在解决的过程中,一度认为是org.w3c.dom.Node.setUserData这个jar有冲突,其实冲突的是它的参数org/w3c/dom/Node,
多个jar中包含了这个org/w3c/dom/Node参数,解决方案是 查看项目中其他jar中 有那些jar 包含了org/w3c/dom/Node参数,再把多余的jar删掉就OK了