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

文章详细介绍了如何解决WebLogic中jar包冲突问题,具体包括更改配置项以避免优先加载程序包,同时保持WebLogic正常运行,并提供了解决方案以避免log4j使用冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值