心有多大舞臺便有多大

          Embrace changes, pursue excellence, share niceness.

          OSGI啟動參數-Dosgi.compatibility.bootdelegation=true的作用

          今天寫le一個bundle,名字叫JmsSendBundle,用spring的jms template來實現發送jms消息.,寫完之后,在eclipse環境中運行都正常,但導出到我的osgi環境中,始終報一個錯誤:java.lang.NoClassDefFoundError: javax/naming/Referenceable
          搞了一上午,最后比較eclipse和我自己的osgi的啟動環境變量,發現eclipse中osgi.compatibility.bootdelegation的值是true,而我的是false,結果把這個參數改成true之后就可以了.
          然后去google了下osgi.compatibility.bootdelegation這個參數的作用,如果該參數值為"true",當一個類或資源查找不到時,類加載器會啟動父類加載器進行最后的查找。該參數的默認值為"true",不知道我的為什么缺省成false了.

          posted on 2008-06-02 13:59 pony 閱讀(1837) 評論(1)  編輯  收藏 所屬分類: Java

          評論

          # re: OSGI啟動參數-Dosgi.compatibility.bootdelegation=true的作用 2014-10-14 22:48 衡蕪

          // set the compatibility boot delegation flag to false to get "standard" OSGi behavior WRT boot delegation (bug 344850)
          if (FrameworkProperties.getProperty(Constants.OSGI_COMPATIBILITY_BOOTDELEGATION) == null)
          FrameworkProperties.setProperty(Constants.OSGI_COMPATIBILITY_BOOTDELEGATION, "false"); //$NON-NLS-1$

          因為你沒有設置,系統默認會設置為false  回復  更多評論   

          主站蜘蛛池模板: 梓潼县| 崇义县| 吕梁市| 台前县| 凤庆县| 余姚市| 白朗县| 探索| 东至县| 湛江市| 洱源县| 松阳县| 靖西县| 正宁县| 永平县| 武定县| 新竹县| 宜宾县| 万载县| 宿迁市| 广平县| 米脂县| 巴南区| 若尔盖县| 邹平县| 潞城市| 福海县| 股票| 建阳市| 葵青区| 望谟县| 宣城市| 永昌县| 五常市| 蒲城县| 高台县| 台州市| 东明县| 新丰县| 天峻县| 塘沽区|