您的位置:首页 > 编程语言 > Java开发

weblogic 启动报错 java.lang.LinkageError: loader constraint violation in interface itable initialization

2015-11-13 11:42 609 查看
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.impl.xs.opti.DefaultElement.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/xerces/impl/xs/opti/DefaultElement, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Element have different Class objects for the type org/w3c/dom/TypeInfo used in the signature
at org.apache.xerces.impl.xs.opti.SchemaDOM.reset(Unknown Source)
at org.apache.xerces.impl.xs.opti.SchemaDOM.<init>(Unknown Source)
at org.apache.xerces.impl.xs.opti.SchemaDOMParser.startDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)

原因:jar包冲突,我的程序中依赖xercesImpl-2.9.1.jar,weblogic也有相应的包,去掉我自己的包就行啦。

在weblogic.xml中,配置prefer-web-inf-classes 为true,表示优先加载,程序中的jar包。weblogic还会加载它自己的,所以就冲突了,将这个值改成false,也行,不用删除程序中的jar,weblogic也能起来,但是log4j也是用的weblogic的了,自己配置log4j配置文件就不管用了。

<container-descriptor> 
<prefer-web-inf-classes>true</prefer-web-inf-classes> 

</container-descriptor> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  weblogic