Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class

Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]:Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/DevProgram/Tomcat6/webapps/ctms/WEB-INF/lib/jaxb-impl-2.1.13.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/)



在spring项目增加cxf后,启动tomcat出现这样的错误

解决方法

按 ( http://java.sun.com/j2se/1.5.0/docs/guide/standards/)去做,通常是解决不了问题的,

该建议信息有两个问题导致不可行:

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目录的,自己创建。



重启tomcat,ok
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值