JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI .解决

JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI ...解决在两年多前。在使用cx

JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI ...解决
   在两年多前。在使用cxf做webservice开发时,就碰到过类似这样的异常:

nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI 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/)


很明显,是说加载了2.0版本的,需要2.1版本的,很可能,你装的就是1.6的jdk, 那么现在今天在新的环境里再次碰到此问题时,又回想起当初,特现在记下处理方式:

将jaxb-api.jar和jaxws-api.jar两个jar包放到%{JAVA_HOME}\jre\lib\endorsed下即可,如果没有endorsed,则新建一个.这两个jar包我放提供在附件里