`
cheneyph
  • 浏览: 295190 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

CXF与jdk1.6兼容问题

    博客分类:
  • java
阅读更多

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:/E:/apache-tomcat-6.0.14/webapps/webService1/WEB-INF/lib/jaxb-impl-2.1.7.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/ )
Caused by: 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:/E:/apache-tomcat-6.0.14/webapps/webService1/WEB-INF/lib/jaxb-impl-2.1.7.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/ )
Caused by: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/E:/apache-tomcat-6.0.14/webapps/webService1/WEB-INF/lib/jaxb-impl-2.1.7.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. (Seehttp://java.sun.com/j2se/1.5.0/docs/guide/standards/ )

CXF框架,因为它能和Spring很好的集成。然后看了  http://www.iteye.com/topic/305642  这位仁兄的文章,着手开始实现第一个简单的程序,然而,在完全按照视频要求完成后,控制台总是报错,说什么

 

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

 

按字面意思就是现在使用的是JAXB 2.0的API,但是需要2.1的API。看了要求去看的网页,然后又在网上找寻了很长时间,问题终于被解决。

 如果看的懂E文的话,可以去看看这篇文章

http://nwangwei.spaces.live.com/Blog/cns!3A3D02B743E87051!240.entry

 

只要按照第一种方法就行了

One way to fix this is to copy  jaxws-api.jar   and  jaxb-api.jar   into JRE endorsed directory, which is  $JAVA_HOME/lib/endorsed   (or$JDK_HOME/jre/lib/endorsed )

 

首先在JDK的lib目录下新建endorsed目录(如果存在就不需要新建了)

然后把jaxws-api.jar 和jaxb-api.jar 拷贝endorsed目录下,问题解决。

 

 

或更新到jdk1.6u11就ok了!

分享到:
评论

相关推荐

    CXF2.6.4配java1.6版完整包和使用说明

    使用CXF 2.6.4时,你需要关注Java版本的兼容性,因为CXF的后续版本可能不再支持Java 1.6。同时,要确保你的开发环境(如IDE)配置正确,以便能够利用CXF提供的全部功能。如果你打算升级到更高版本的Java或CXF,务必...

    jaxb-xjc-2.1.13.jar

    为了解决cxf webservice访问与jdk1.6版本之间不兼容问题

    cxf-2.7.17

    8. **兼容性与稳定性**:"2.7.17"这个版本经过了广泛的测试,确保了与JDK 1.6的良好兼容性,同时也修复了一些已知问题,提高了整体的稳定性和性能。 在实际应用中,开发者可以通过Maven或Gradle等构建工具将"CXF ...

    cxf框架中的neethi.jar包

    4. **兼容性**:`neethi.jar`包特别适用于`JDK1.6`及更低版本的Web服务框架。由于`CXF`框架的不断升级,对于高版本的JDK,可能存在兼容性问题。这意味着在更新的Java环境中,可能需要寻找替代的策略处理库,或者使用...

    CXF_WebService_开发指南、技术文档

    对于JDK 1.6及以下版本,也需要特别注意这一问题。解决方案包括使用`apt`命令进行预编译或者升级JDK至1.6u17及以上版本。 **发布服务**: ```java import org.apache.cxf.jaxws.JaxWsServerFactoryBean; public ...

    Web Service基础教程带实例

    JAX-WS 2.1是JDK1.6自带版本,它继承自JAX-RPC(Java API for XML Remote Procedure Call),但JAX-WS并不完全向后兼容JAX-RPC。JAX-WS使用注解,使得开发者可以更方便地编写和使用Web服务。 2. JAXM&SAAJ(Java ...

    JAVA如何调用wsdl过程详解

    如果使用的是JDK 1.6,由于其对ws2.1规范的支持,可能会遇到版本不兼容的问题。建议升级JDK至1.7,并且在JDK文件夹下的jre/lib/endorsed路径中添加apache-cxf中jaxb对应的jar包。 b. 其次,在生成Java文件并导入...

Global site tag (gtag.js) - Google Analytics