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

阅读更多
环境:tomcat6.0 + myeclipse6.5 + jdk1.6.20
jax-ws调用的时候总是报以下异常,确定是包的版本问题。如下:
Java代码  收藏代码
nested exception is java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/Program%20Files/MyEclipse%206.5/myeclipse/eclipse/plugins/com.genuitec.eclipse.ws.xfire_6.5.0.zmyeclipse650200806/lib/webservices-rt.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 
 
具体异常如下:-------------- 
2011-2-12 9:12:18 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources 
信息: No cxf.xml configuration file detected, relying on defaults. 
2011-2-12 9:12:19 org.apache.cxf.bus.spring.SpringBusFactory createApplicationContext 
警告: Initial attempt to crate application context was unsuccessful. 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/D:/Program%20Files/MyEclipse%206.5/workspace/tesr/src/main/web/WEB-INF/lib/cxf-2.2.1.jar!/META-INF/cxf/cxf.fixml]: 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.LinkaAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/Program%20Files/MyEclipse%206.5/myeclipse/eclipse/plugins/com.genuitec.eclipse.ws.xfire_6.5.0.zmyeclipse650200806/lib/webservices-rt.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.  
    ... 28 more 

网上找了找方法:大致有以下几种
1,说是在jdk的安装目录下的JRE目录下新建个endorsed文件夹,在此目录下放入jaxb-api.jar和jaxws-api.jar包,即可解决问题。
2。说是把JDK升级到jdk1.6u11版本可解决。
3. 不使用myeclipse6.5

于是动手解决问题:
按第一种方法:在JDK安装目录中加endorsed及包,结果我这边还是一样报异常,没有任何变化。不知道其他朋友能否成功,估计各自的环境不一样吧。(tom6 + jdk1.5 此方法有效)
按第二种方法:我没有尝试,不太清楚各种版本的高低级,不知道能否成功,有成功的朋友说一声。我也不可能不用myeclipse6.5。
于是我一狠心把javaEE这个包删除掉,结果正常了。虽然清楚是版本问题,但具体出在哪,怎么最好的解决这个问题,还真是没有想清楚。结果正常后又把javaEE的包加进来再发布运行结果还是正常,纠结这个问题到底是出在哪还有待进一步测试。有搞清楚的朋友支个声
jaxws-api.jar (35.3 KB)
下载次数: 257
jaxb-api.jar (87.9 KB)
下载次数: 223

你可能感兴趣的:(myeclipse,jdk,javaee,bean,tomcat)