CXF:java.lang.AbstractMethodError:org.apache.xerces.dom.ElementNSImpl.setUserData
2017-10-19 11:22
429 查看
前言:
在一个JavaWeb项目中,要接入WebService时,使用CXF,但是接入的时候出现异常:
java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
at org.apache.cxf.staxutils.StaxUtils.addLocation(StaxUtils.java:1133)
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1021)
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:994)
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:921)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:231)
解决过程:
根据网上查找的答案,是因为xerces-2.6.2.jar这个jar包冲突,将xerces升级到2.8以上版本就不会有这个问题。
1、将xerces-2.6.2.jar从项目中删除。
2、因为本项目是maven项目,直接在pom.xml中添加2.8版本的xerces依赖
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
</dependency>
3、重新运行项目,异常解决成功!
在一个JavaWeb项目中,要接入WebService时,使用CXF,但是接入的时候出现异常:
java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
at org.apache.cxf.staxutils.StaxUtils.addLocation(StaxUtils.java:1133)
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1021)
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:994)
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:921)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:231)
解决过程:
根据网上查找的答案,是因为xerces-2.6.2.jar这个jar包冲突,将xerces升级到2.8以上版本就不会有这个问题。
1、将xerces-2.6.2.jar从项目中删除。
2、因为本项目是maven项目,直接在pom.xml中添加2.8版本的xerces依赖
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
</dependency>
3、重新运行项目,异常解决成功!
相关文章推荐
- java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData
- org.apache.xerces.dom.ElementNSImpl.setUserData
- java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl$DaysInMonth
- 错误解决:java.lang.ClassCastException: org.apache.xerces.dom.DeferredDocumentImpl
- 关于java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion问题的解决
- java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion问题解决方法
- 错误修复:java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl$Parser
- java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredTextImpl cannot be cas
- 疑难杂症:java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/String;)V
- java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion
- java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredCommentImpl cannot be c
- java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
- weblogic10.3 java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
- java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.getNamespaceContext()
- java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar
- weblogic10.3 java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
- java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
- java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
- java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
- Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.dataimportHandler