CONAN ZONE

          你越掙扎我就越興奮

          BlogJava 首頁(yè) 新隨筆 聯(lián)系 聚合 管理
            0 Posts :: 282 Stories :: 0 Comments :: 0 Trackbacks

          JavaSE 6 comes with JAXB 2.0 API in rt.jar . Therefore, using JAXB 2.1 with JavaSE 6 requires one to override a portion of rt.jar with the new API. There are several ways to do this:

          1. Place the 2.1 jaxb-api.jar into $JRE_HOME/lib/endorsed . This essentially makes your JRE to "JRE 6 + JAXB 2.1". This won't affect any other applications that use this JRE, and it's easy. On the other hand, in various scenarios you may not be able to alter the JRE.
          2. Use the system property java.endorsed.dirs when you launch your application, and have it point to the directory that contains the 2.1 jaxb-api.jar . This allows you use use JAXB 2.1 without modifying the JRE. Make sure not to include any other JAXB RI jar files (such as jsr173-api.jar or jaxb-impl.jar .)
          3. Implement a custom ClassLoader and block delegation to javax.xml.bind package, so that code running inside this class loader will load the JAXB API from elsewhere. This is a very advanced approach.

          No matter which approach you take, make sure not to include jar files other than jaxb-api.jar . Doing so, for example including jaxb-xjc.jar , may result in classloading related errors such as "taskdef A class needed by class com.sun.tools.xjc.XJCTask cannot be found: org/apache/tools/ant/...."

          See the endorsed directory mechanism for more details.


          jdk6update12也可解決
          posted on 2009-03-07 21:50 CONAN 閱讀(516) 評(píng)論(0)  編輯  收藏 所屬分類: Web Service
          主站蜘蛛池模板: 利辛县| 张掖市| 台南县| 日照市| 巴南区| 松滋市| 尼木县| 汾西县| 荥阳市| 云阳县| 桐梓县| 镇坪县| 焉耆| 进贤县| 黄冈市| 松潘县| 洛扎县| 平武县| 陆丰市| 启东市| 杭锦旗| 秦安县| 凌云县| 连云港市| 永修县| 定西市| 靖安县| 巴林右旗| 乌拉特后旗| 南皮县| 惠东县| 凌源市| 济阳县| 锡林浩特市| 亚东县| 乌鲁木齐县| 雅江县| 德令哈市| 汾阳市| 潜山县| 长丰县|