Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » org.osgi.framework.system.packages
org.osgi.framework.system.packages [message #123133] Wed, 17 December 2008 12:42 Go to next message
Eclipse UserFriend
Originally posted by: Jens.Borrmann.gillardon.de

Hello,

I want to use org.osgi.framework.system.packages for some packages that
do not live in bundles available in our OSGi runtime, e.g. the db driver.
The OSGi spec says in 3.8.5 that classes from these packages will be
taken from the parent class loader. How can I make classes available to
the parent classloader ...

.... a) In Eclipse using Equinox launch configurations. My first guess
was to use the bootstrap field on the settings tab, which - as an long
debugging session revealed - seems to be the wrong place to do this. The
system.packages option was included in the vm arguments (-Dorg.osgi....).

.... b) From the command line. I used java -cp osgi.jar;dbdriver.jar -jar
osgi.jar. The system.packages option was include in my config.ini file.

BTW, in both cases debugging revealed that the BundleLoader tried to
load the driver class from the system package in step 3 of
findClassInternal (i.e. imported packages), which shows that the
system.packages option was evaluated correctly.

We do _not_ want to use boot delegation, if we can avoid it.

Can anybody give me a hint, or am I getting something terribly wrong?

Thanks, Jens
Re: org.osgi.framework.system.packages [message #123283 is a reply to message #123133] Fri, 19 December 2008 13:44 Go to previous message
Eclipse UserFriend
Originally posted by: Jens.Borrmann.gillardon.de

Hello,

I found the answers:

a) Using the right configuration for the parent class loader (app)
everything worked with bootstrap entries.

b) The cause for the problem was too obvious. VM option -jar disables
everything configured with -cp. Therefore there was no chance for the
system bundle to find the db driver class. Starting everything with
java -cp osgi.jar;dbdriver.jar
org.eclipse.core.runtime.adaptor.EclipseStarter
helped.

BTW: It does not seem to be a good idea to enable log level trace for
org.springframework.osgi.util.trace. They do a lot of class loading in
order to gain some information on CNFE. This can too easy be mixed with
the "normal" class loading.

--- Jens
Previous Topic:How to use OSGi bundle together with traditional plug-in?
Next Topic:Package uses conflict - How to find the reason?
Goto Forum:
  


Current Time: Tue Mar 19 11:17:22 GMT 2024

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

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

Back to the top