当前位置:首页 > Windows程序 > 正文

JAXB 2.0 API is being loaded from the bootstrap classloader

2021-05-25 Windows程序

在使用webservice,mule esb等需要jaxb的项目里经常会出现 JAXB 2.0 API is being loaded from the bootstrap classloader这个错误,按照打出的信息Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See )去做,,通常是解决不了问题的,该建议信息有两个问题导致不可行:

1. 不是下载jaxb-api.jar 而是下载jaxb-api-2.1.jar文件

2.不是把下载的这个jar文件放在sun网站给出的<java-home>/lib/endorsed 下,而是要自己试验确定应该放在哪个目录下:

确定放在哪个目录下的方法如下:

首先要看你的项目是java项目还是java web项目:

A, java项目直接打印System.out.println(System.getProperty("java.endorsed.dirs"));即是jaxb-api-2.1.jar应该放的目录。

B, java web 项目要用一个可以正常启动的web项目(当然没用到jaxb的web项目),打印System.out.println(System.getProperty("java.endorsed.dirs"));即可,我的是java web项目,打出的是E:/tomcat6/common/endorsed

我把jaxb-api-2.1.jar放到E:/tomcat6/common/endorsed下后问题解决。

注:没有common/endorsed目录的,自己创建。

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/71158.html