2
votes

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?

Message: 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/)

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/)

3

3 Answers

2
votes

Put your JAXB 2.2 JARs in

%JAVA_HOME%\lib\endorsed

It should work.

If your Java is installed in

C:\Program Files\Java

then you should put JAXB 2.2 JARs in:

C:\Program Files\Java\lib\endorsed

directory.

2
votes

I don't know exactly why, but I solved it in following way.

I realized Tomcat was using a JVM (jre1.6.0_03) that was not the default one (jre1.6.0_26, in folder C:\Program Files\Java\jre6).

So I stopped Tomcat, launched the program "Configure Tomcat", in "Java" tabsheet chose "Use default" and then started again Tomcat.

0
votes

Put your JAXB 2.2 JARs in folder, you need first find out where this folder is using this:

System.out.println(System.getProperty("java.endorsed.dirs"));

Mine was d:\Tomcat 7.0\endorsed