Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » org.osgi.framework.bootdelegation and org.osgi.framework.system.packages, how they function?
org.osgi.framework.bootdelegation and org.osgi.framework.system.packages, how they function? [message #640094] Fri, 19 November 2010 04:57 Go to next message
guofeng zhang is currently offline guofeng zhangFriend
Messages: 49
Registered: July 2009
Member
I read the core specification, it seems that a package in rt.jar can be imported successfully by a bundle if the package listed in org.osgi.framework.bootdelegation OR org.osgi.framework.system.packages, because in these cases the package loading will be delegated to parent class loader.

My bundle imports "sun.misc", Virgo has listed as "sun.*" in org.osgi.framework.bootdelegation, but my bundle's import constraint cannot be met, so the deployment failed. I have to add "sun.misc" to org.osgi.framework.system.packages.


What causes the difference? or do I misunderstand the specification?

Thanks for your assistance.

Re: org.osgi.framework.bootdelegation and org.osgi.framework.system.packages, how they function? [message #640148 is a reply to message #640094] Fri, 19 November 2010 10:44 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Boot delegation is for packages which are loaded without specifying an import. The system packages property produces exports from the system bundle which must then be imported.

You should use system packages when in some environments a package will be provided by the system bundle and in other environments a separate bundle will be installed to provide the package. You should also use system packages when you want explicit wiring from using bundles to the exporter of the packages.

You should use boot delegation for JRE implementation packages or for packages which would be troublesome to import into every bundle that needed them. (For instance, a few years ago there have been problems in the JRE reflection support such that JRE internals which should have been loaded by the boot class loader were actually initiated as class loads against a bundle class loader. Rather than "infecting" the bundle with imports of JRE internal packages, it was reasonable to use boot delegation in this case. However, I haven't seen that behaviour in recent JREs, so hopefully it is fixed.)

I hope that's clear. There are some words in the Virgo user guide which may also help.
Previous Topic:Publish service from web bundle
Next Topic:An Import-Package could not be resolved. constraint: <Import-Package: javax.validation; version=
Goto Forum:
  


Current Time: Wed Apr 24 18:28:00 GMT 2024

Powered by FUDForum. Page generated in 0.02959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top