问题描述
我正在尝试将我的 web 应用程序加载到 Tomcat 中.似乎在抱怨它的 JAR 版本比我的应用程序旧.我应该删除旧的 JAR,使用更新版本的 Java,编辑引导类加载器(如何?)还是什么?
I am trying to load my webapp into Tomcat. It seems to be complaining that it has an older version of a JAR than my application. Should I remove that older JAR, use a newer version of Java, edit the bootstrap classloader (how?) or what?
消息:正在从引导类加载器加载 JAXB 2.1 API,但是这个 RI(来自 jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/SkillsDB/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) 需要 2.2 API.使用背书目录机制将 jaxb-api.jar 放在引导类加载器中.(参见 http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
Caused by: Executing action [getDocx] of controller [FormattedDocumentController] 导致异常:java.lang.LinkageError
: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:文件:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/SkillsDB/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) 需要 2.2 API.使用背书目录机制将 jaxb-api.jar 放在引导类加载器中.(参见 http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
Caused by: Executing action [getDocx] of controller [FormattedDocumentController] caused exception: java.lang.LinkageError
: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/SkillsDB/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
推荐答案
将您的 JAXB 2.2 JAR 放入
Put your JAXB 2.2 JARs in
%JAVA_HOME%\lib\endorsed
它应该可以工作.
如果您的 Java 安装在
If your Java is installed in
C:\Program Files\Java
那么您应该将 JAXB 2.2 JAR 放入:
then you should put JAXB 2.2 JARs in:
C:\Program Files\Java\lib\endorsed
目录.
这篇关于在 Tomcat 中,java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!