Tomcat JAXB 1和2链接错误
我正在运行 tomcat 6、spring、apache cxf webservice,知道这是必须的 将一个第三方库添加到我的网络应用程序中以完成订单。
我在 WEB-INF/lib 文件夹中有用于 apache cxf 的 jaxb-impl-2.1.12.jar 和新的 包含 JAXB 1.0 运行时的库。
JAXB 2 由 apache cxf 用于动态客户端(我需要它们)。
那么是否有可能同时使用这两个库来运行网络应用程序呢?
错误:
Caused by: java.lang.LinkageError: You are trying to run JAXB 2.0 runtime but you have old JAXB 1.0 runtime earlier in the classpath. Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.
I'm running a tomcat 6, spring, apache cxf webservice, know it is a must to
add one third party library to my webapp to fulfill an order.
I have jaxb-impl-2.1.12.jar for apache cxf in WEB-INF/lib folder and the new
library which contains the JAXB 1.0 runtime.
JAXB 2 ist used by apache cxf for dynamic clients (i need them).
So is there a possibility to run the webapps with both libraries?
Error:
Caused by: java.lang.LinkageError: You are trying to run JAXB 2.0 runtime but you have old JAXB 1.0 runtime earlier in the classpath. Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JAXB2 参考实现包含一个 JAXB1 的向后兼容性库,称为
jaxb1-impl.jar
。您需要从获取 jaxb-impl-2.1.12.jar 的同一位置找到该 JAR。如果您只是将旧的 JAXB1 JAR 与 JAXB2 放在一起,它将以您所描述的方式失败。
The JAXB2 reference implementation contains a backward-compatibility library for JAXB1, called
jaxb1-impl.jar
. You need to track down that JAR from the same place you gotjaxb-impl-2.1.12.jar
.If you just drop the old JAXB1 JAR in alongside JAXB2, it will fail in the manner you describe.