您的位置:首页 > 编程语言 > ASP

metasploit-渗透测试工具

2010-12-26 04:36 375 查看
最近接手一个带有CXF的项目,在工程启动时报错

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]:
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/)

java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/D:/apache-tomcat-6.0.16/webapps/were/WEB-INF/lib/jaxb-impl-2.1.17.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/)

 

很奇怪,工程使用的JAXB 2.1,却一直提示加载到的是2.0版本。
刚开始一直怀疑是项目中有地方使用到了jaxb2.0的api,查了一个多小时也没有找到。

后来上网查找,原来是JDK1.6与cxf的兼容性有问题。

 

找到了两种解决办法
1 将JDK升级到jdk1.6.0_14(jdk1.6u11)

 

2 将jaxws-api.jar 和 jaxb-api.jar
拷贝到 $JAVA_HOME/lib/endorsed 或者 $JDK_HOME/jre/lib/endorsed ,如果没有 endorsed目录则新建一个
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: