java.lang.LinkageError:加载器约束冲突

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5731604/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 12:31:24  来源:igfitidea点击:

java.lang.LinkageError: loader constraint violation

javajsfclassloader

提问by ayscha

Good day everyone,

今天是个好日子,

i have faced with such an issue as linkage error like this:

我遇到过像这样的链接错误这样的问题:

java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.transform.Transformer.transform(Ljavax/xml/transform/Source;Ljavax/xml/transform/Result;)V" the class loader (instance of org/jboss/mx/loading/UnifiedClassLoader3) of the current class, org/richfaces/renderkit/TemplateEncoderRendererBase, and the class loader (instance of <bootloader>) for resolved class, javax/xml/transform/Transformer, have different Class objects for the type javax/xml/transform/Source used in the signature

I have googled a lot, but all i found is the suggestion to exclude from classpath such kind of libs as xml-apis-2.9.1.jar or jaxrpc-1.1.jar. I did that, but i still have the same error. This library is actually included into jdk 1.6 (rt.jar).

我用谷歌搜索了很多,但我发现的只是从类路径中排除诸如 xml-apis-2.9.1.jar 或 jaxrpc-1.1.jar 之类的库的建议。我这样做了,但我仍然有同样的错误。这个库实际上包含在 jdk 1.6 (rt.jar) 中。

So, i did check all my included jars and it seems no kind of jars that might use target class...

所以,我确实检查了我所有的罐子,似乎没有可能使用目标类的罐子......

Maybe i don't take in account smth? is there some magic trick??

也许我没有考虑到什么?有什么魔术吗??

Thanks' for help in advance.

提前感谢您的帮助。

采纳答案by ayscha

The issue is fixed. the strange thing was that jaxrpc-1.1.jar remained in appi.war\WEB-INF\lib, which is very weird as i exclude it from classpath and redeploy everything.

问题已解决。奇怪的是 jaxrpc-1.1.jar 仍然在 appi.war\WEB-INF\lib 中,这很奇怪,因为我将它从类路径中排除并重新部署了所有内容。