心有多大舞台便有多大

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 阅读(1793) 评论(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  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: