我的 Tibco BW 6.3.2 项目调用了一些在我的机器上运行的 Java 代码,但我在服务器上遇到了问题。
起初,我得到了这个错误
<CausedBy> java.lang.ClassNotFoundException: com.sun.xml.bind.v2.model.annotation.AnnotationReader cannot be found
所以谷歌搜索并添加jaxb-impl.jar
和jaxb-core.jar
(JAXB v2.2.11)。同样,它可以在我的机器上运行,而无需将它们添加到类路径中。但是一旦我添加了它们,我就在服务器上收到了这个错误:
<CausedBy> java.lang.RuntimeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
<CausedBy> java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
再次,我用谷歌搜索并添加了xercesImpl.jar
. 但现在我在我的机器和服务器上得到了这个:
<CausedBy> java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
经过一些谷歌搜索,我确定xerces
我的项目中有 2 个 jar,但我找不到第二个。关于如何做到这一点的任何想法?或者有人有不同的解决方案吗?
旁注,java 代码在 Eclipse 中工作得非常好,没有任何这些库添加到类路径中。(所有设备都使用 Sun JDK 1.8.0_92)