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 signatureat 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>