`

解决JAXB2.1和JDK1.6/6.0的问题

 
阅读更多

解决JAXB2.1和JDK1.6/6.0的问题

方案1:

1.8. Using JAX-WS 2.1 with JavaSE6

JavaSE6 ships with JAX-WS 2.0 API in rt.jar, which causes some trouble when you try to run applications that use JAX-WS 2.1 API. This document collects information about how to solve this issue.

1.8.1. Endorsed directory

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)

Some application containers, such as Glassfish, modifies the location of the endorsed directory to a different place. From inside the JVM, you can check the current location by doing System.out.println(System.getProperty("java.endorsed.dirs"));

Obviously you still need other JAX-WS jars in your classpath.

Please do not put all the jars to the endorsed directory. This makes it impossible for JAX-WS RI to see other classes that it needs for its operation, such as servlet classes on the server-side, or Ant classes in the tool time. As those are not loaded by the bootstrap classloader, you'll get NoClassDefError on servlet/Ant classes.

方案2:

Support for JDK 1.6

Jbossws 2.0.1.GA is based on the jax-ws and jaxb versions 2.1. But JDK 1.6 ships jaxb 2.0 classes as part of the core distribution (rt.jar). So in order for the jboss jars to take precedent over the jdk supplied jars, we have to use the endorsed directory mechanism, as described here. The above link is for using jaxws ri 2.1, but we need jbossws 2.0.1. For that purpose copy the following 3 jars in to the jboss/lib/endorsed directory.

So assuming your jboss is setup in a directory /jboss and you have already installed jbossws 2.0.1 on top of it, Copy the following 3 files to /jboss/lib/endorsed.

  • /jboss/server/default/lib/jboss-saaj.jar
  • /jboss/server/default/lib/jboss-jaxws.jar
  • /jboss/client/jaxb-api.jar

The jboss run script is already configured to add the /jboss/lib/endoresed directory to the list of endorsed directory. So jars in this directory will take precedence over rt.jar.

分享到:
评论

相关推荐

    java jdk1.6 新特性 jaxb2 demo

    java jdk1.6 新特性 jaxb2 demo

    JDK1.6新特性与实战例子

    StAX(JSR 173)是JDK6.0中除了DOM和SAX之外的又一种处理XML文档的API JDK6的新特性之四:使用Compiler API 现在我们可以用JDK6 的Compiler API(JSR 199)去动态编译Java源文件 JDK6的新特性之五:轻量级...

    jaxb2.1jar包

    这个是jaxb2.1 jar包,这里提供下载,只要2个资源分哦,大家可以踊跃下载

    JAXB自定义命名前缀无效的问题

    NULL 博文链接:https://201208252245.iteye.com/blog/2036875

    开发JAR包集合-cxf/dom4j/jaxb/json/jta/jxl

    开发JAR包集合-cxf/dom4j/jaxb/json/jta/jxl 解压文件得到如下jar包 cxf-2.2.8.jar dom4j-1.6.1.jar ehcache-core-2.2.0.jar jaxb-api-2.2.jar jaxb-impl-2.2.jar json-lib-2.4-jdk15.jar json-lib-ext-...

    jaxb-impl.jar包

    jaxb-impl-2.1.jar包很有作用的,希望你们能喜欢

    JDK1.6的九大新特性

    JDK1.6的九大新特性 九:Common Annotations 八:对脚本语言的支持 七:用Console开发控制台程序 六:插入式注解处理API(Pluggable Annotation Processing API) 五:轻量级Http Server API 四:使用Compiler API 三...

    jaxb-api-2.1.jar

    目录下可以解决JAXB 2.0 API is being loaded from the bootstrap classloader错误. 注意:java web 项目必须在一个发布后的可以正常启动的web项目里打印。和java项目打印出的目录是不一样的。

    jaxb-impl-2.1.jar

    jaxb-impl-2.1.jar

    JDK+6.0+ZH+API.chm.zip

    JDK6的新特性之二_使用JAXB2来实现对象与XML之间的映射 JDK6的新特性之三_理解StAX JDK6的新特性之四_使用Compiler API JDK6的新特性之五_轻量级HttpServer JDK6的新特性之七_用Console开发控制台程序 JDK6的...

    jaxb-2_1_9.zip

    使用MyEclipse5.5+jboss-5.0.0.CR1+JDK1.6,在启动时报了一个错误: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file://build/web/WEB-INF/lib/...

    JPA-XJC:一个JAXB 2.1 XJC插件-开源

    JPA-XJC是一个JAXB 2.1 XJC插件,用于使用Java持久性注释对模式派生类进行注释。 它不会根据JPA 1.0以外的库生成代码,并且不会引入非标准的自定义元素。

    jaxws-api-2.1_jaxb-api-2.1.jar

    jaxws-api-2.1.jar jaxb-api-2.1.jar geronimo-jaxws_2.2_spec-1.1.jar 在webservice中常用的几个jar包,

    jaxb-api-2.1.jar 和 jaxb-impl-2.1.8.jar

    jaxb-api-2.1.jar 和 jaxb-impl-2.1.8.jar

    jdk10+ java.lang.NoClassDefFoundError: javax/xml/ws/Service 错误

    1、解决方案jdk降级至1.8之前 2、由于JDK9以后,去除了javax.xml包需要引入对应的jar包 <groupId>javax.activation</groupId> <artifactId>javax.activation-api</artifactId> <version>1.2.0</version> </...

    JAXB API jar 用于JDK9.0 解决Hibernate

    JDK9.0使用Hibernate框架时,抛出java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException异常就是因为缺少这些包,亲测可用

    jax-ws-2.2.rar

    在Tomcat上发布webservice所需要的jar包,总共25个:FastInfoset.jar/gmbal-api-only.jar/ha-api.jar/javax.annotation.jar/javax.mail_1.4.jar/jaxb-api.jar/jaxb-impl.jar/jaxb-xjc.jar/jaxws-api.jar/jaxws-rt....

Global site tag (gtag.js) - Google Analytics