简体   繁体   English

问题xerces,xml-apis JDK1.4到JDK1.7

[英]Problems xerces, xml-apis JDK1.4 to JDK1.7

First of all sorry if there is something like that but i haven´t found it, or at least i haven´t found a solution to my problem 首先,抱歉是否有类似的东西,但我还没有找到,或者至少我没有找到解决问题的方法

I'm upgrading a project developed in jdk4 using libraries such as xml-apis, xerces or xercesImpl managed by Maven. 我正在升级使用由Maven管理的xml-apis,xerces或xercesImpl之类的库在jdk4开发的项目。

Now the new version is developed with jdk7 . 现在,新版本是使用jdk7开发的。 Here is when troubles comes. 这是麻烦来临时。 When I pack the application everything it´s ok. 当我打包应用程序时,一切正常。 If I use Tomcat it´s ok as well, but when I access to it by Weblogic the log says: 如果我使用Tomcat也可以,但是当我通过Weblogic访问它时,日志显示:

Class org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy does not implement 
the requested interface org.xml.sax.Attributes

I´ve tried most of things but I don´t know how to solve it. 我已经尝试了大多数方法,但是我不知道如何解决。 Thanks in advance 提前致谢

Everything in xml-apis has been included in the core Java class library since Java 5, so you should exclude any transitive dependencies on xml-apis in your pom. 从Java 5开始, xml-apis中的所有内容都已包含在核心Java类库中,因此您应该在pom中排除对xml-apis任何传递性依赖。 The error message you're seeing tends to occur when you have different classloaders in the mix, with the xerces classes binding to interfaces from xml-apis but other code trying to cast them to the same interface as defined by rt.jar. 当您混合使用不同的类加载器时,您看到的错误消息往往会发生,其中xerces类绑定到xml-apis的接口,但其他代码尝试将它们转换为rt.jar定义的相同接口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM