Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkageError JAXB 2.0 -> 2.1 (Tomcat)

I'm getting this error when trying to access my webservice running inside tomcat.

Caused by: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/software/tomcat6/webapps/messaging/WEB-INF/lib/jaxb-impl-2.1.5.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)

I googled for the error and did what should solve it (I put jaxb-api.jar, version 2.1 in JDK/lib/endorsed and JDK/jre/lib/endorsed) but it doesn't appear to have any effect.

I didn't have it before, and I'm not sure what was changed. I use JDK 6u10.

like image 266
Bart van Heukelom Avatar asked Apr 07 '09 12:04

Bart van Heukelom


1 Answers

Java 6u10 includes JAXB 2.1, so there is no need to include it at all (it has been included since 6u4).

Right now it looks like you have a conflict between JAXB included with a webapp and the bundled JAXB that comes with JRE. You could try removing the JAXB jar from your webapp (C:/software/tomcat6/webapps/messaging/WEB-INF/lib/jaxb-impl-2.1.5.jar) and rely on the built-in version.

like image 177
andri Avatar answered Sep 28 '22 07:09

andri