【发布时间】:2012-09-29 17:24:36
【问题描述】:
我正在尝试在 Eclipse RCP 应用程序中使用 Xerces 2.11.0,但是从我尝试过的所有内容来看,我不知道该怎么做。更复杂的是,我也在尝试使用 Batik 1.7。
我已经为 Xerces 和 xml-apis 创建了自己的包,我已经将 Batik 使用的其他 W3C DOM 接口添加到了我的 xml-apis 包中。
蜡染中出现的第一个问题
java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
其根本原因似乎是因为 org.w3c.dom 包含在 JRE 中并通过 org.eclipse.osgi(system.bundle)公开。这似乎胜过任何其他想要提供该软件包的捆绑包。
试图在任何其他人之前使用 require-bundle 和我的 bundle 来影响系统,或使用带有显式版本的 import-package 会导致类似的错误
java.lang.LinkageError: loader constraint violation: loader
(instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
previously initiated loading for a different type with name
"org/w3c/dom/Document"
更改 org.osgi.framework.system.packages 和 org.osgi.framework.bootdelegation 参数以删除 org.w3c.dom 并将我的包添加到 osgi.framework.extensions,会导致类似的错误
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method
"javax.xml.parsers.DocumentBuilder.setErrorHandler(
Lorg/xml/sax/ErrorHandler;)V" the class loader
(instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
of the current class, org/apache/log4j/xml/DOMConfigurator, and the
class loader (instance of <bootloader>) for resolved class,
javax/xml/parsers/DocumentBuilder, have different Class objects for the
type rrorHandler;)V used in the signature
我也尝试过使用 java.endorsed.dirs,这会让事情很快崩溃。
我错过了什么或可能做错了什么?
【问题讨论】:
标签: eclipse osgi eclipse-rcp xerces