POI失败
java.lang.LinkageError: loader constraint violation in interface itable initialization:when resolving method "org.apache.xerces.parsers.AbstractSAXParser.getEntityResolver()Lorg/xml/sax/EntityResolver;" the class loader (instance of com/newatlanta/servletexec/ApplClassLoader) of the current class, org/apache/xerces/parsers/AbstractSAXParser, and the class loader (instance of <bootloader>) for interface org/xml/sax/XMLReader have different Class objects for the type org/xml/sax/EntityResolver used in the signature
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
at org.dom4j.io.SAXReader.read(SAXReader.java:435)
at org.dom4j.io.SAXReader.read(SAXReader.java:343)
at org.openxml4j.opc.internal.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:396)
at org.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:120)
at org.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:63)
at org.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:147)
at org.openxml4j.opc.Package.getParts(Package.java:598)
at org.openxml4j.opc.Package.open(Package.java:227)
我在ServletExec上使用XMLBean时遇到了这个问题。我该如何解决?
答案 0 :(得分:2)
从应用程序的类路径中删除xercesImpl-jar
并重新部署它。如果由于删除特定jar而引起任何其他问题,请尝试这样做。然后不要删除jar.Just提取jar并从org.apache.xerces.parsers.AbstractSAXParser
中删除xercesImpl-jar
类文件,这会导致冲突并转换剩余的类文件进入jar并将其加载到classpath.It将帮助您解决链接错误。
答案 1 :(得分:1)
您似乎正在部署xerces-parser以及您的应用程序,尽管它已经是服务器的一部分 - 并且服务器似乎扼杀了它。尝试从部署中删除xercesImpl-jar,例如如果maven将其范围设置为provided
。