websphere 8.5 for SAXParser中的链接错误

websphere 8.5 for SAXParser中的链接错误,websphere,linkageerror,Websphere,Linkageerror,在部署我的应用程序WebSphere8.5时,我面临一个与链接相关的问题 Error in the XML parsing of the included Input Stream: java.lang.LinkageError: loading constraint violation when resolving method "javax/xml/parsers/SAXParser.parse(Lorg/xml/sax/InputSource;Lorg/xml/sax/helpers/De

在部署我的应用程序WebSphere8.5时,我面临一个与链接相关的问题

Error in the XML parsing of the included Input Stream: java.lang.LinkageError: loading constraint violation when resolving method "javax/xml/parsers/SAXParser.parse(Lorg/xml/sax/InputSource;Lorg/xml/sax/helpers/DefaultHandler;)V" : loader "com/ibm/ws/classloader/CompoundClassLoader@aa54261e" of class "com/XMLParser/CreateParser" and loader "com/ibm/oti/vm/BootstrapClassLoader@1c4565b7" of class "javax/xml/parsers/SAXParser" have different types for the method signature.
我的类路径中有以下JAR。 我已将加载程序设置为PARENT_LAST

我尝试使用main方法单独调试该类,发现它采用JDK1.5RT.jar的saxparser的impl,并且工作正常。在部署ear之后,当代码命中SAXParser.parse(InputsRouce,DefaultHandler)方法时,它会抛出异常

jaxb impl 2.2.6, jaxb-libs-1.0.5, jaxb-xjc-2.0EA3, dom4j-1.1, SAX2.0.1


有人知道这个问题吗?

您的类加载器可以看到org.xml.sax的两个副本。第一个是因为在父类装入器中包含了SAXAPI,第二个是通过JRE中的javax.xml.parsers间接实现的。您或者需要从应用程序中删除SAXAPI JAR,或者需要将javax.xml(或者更多)API+impl添加到应用程序中