|
|
Re: Classloader Questions -- solved. [message #90078 is a reply to message #90048] |
Fri, 08 June 2007 05:47 |
Eclipse User |
|
|
|
Originally posted by: stepper.sympedia.de
Brett,
The Equinox ServletBridge does a similar trick to export the javax.servlet package of the embedding web container. There the system.bundle fragment is created and persisted on the fly.
But I was not aware that it was necessary to additionally fiddle with any system properties. Have you tried to only deploy your fragment into an otherwise unmodified platform?
Cheers
/Eike
Brett Humphreys schrieb:
> Apparently creating a system.bundle fragment was the correct solution.
>
> The final solution was to:
> set org.osgi.framework.bootdelegation property to "c.a.d.c.boot.*"
> set osgi.parentClassLoader to "app"
> create a fragment bundle with no code in it and the following manifest:
>
> Manifest-Version: 1.0
> Bundle-SymbolicName: c.a.d.c.boot
> Bundle-ManifestVersion: 2
> Fragment-Host: system.bundle
> Export-Package: c.a.d.c.boot
>
>
> I didn't realize how crucial the fragment bundle was to bridging these
> classloaders.
>
> -Brett
>
|
|
|
|
|
Re: Classloader Questions -- solved. [message #91045 is a reply to message #90093] |
Thu, 21 June 2007 17:35 |
Brett Humphreys Messages: 17 Registered: July 2009 |
Junior Member |
|
|
One follow up to this. If I have a 3rd party jar (foo.jar) which provides org.db.foo, that I want
to use within my bundles, but for argument's sake, I'm too lazy to wrap it as a bundle itself, and
too lazy create a system.bundle frag to bridge it. I would have thought I could set the
bootdelegation property to be org.db.foo.* and add add foo.jar to the jvm's classpath and all would
work properly, but this doesn't seem to work at all.
I half expected this to only work with classes in the SystemClassLoader, but the jars on the
classpath I believe are loaded into the system classloader.
That being said, I did add javax.* to the bootdelegation property and that seems to work just fine.
But setting the bootdelegation property to "javax.* org.db.foo.*" worked for swing, but not the
classes in org.db.foo.
What am I missing regarding this property?
Thanks.
-Brett
Danail Nachev wrote:
>
> If you set the bootdelegation property, then you don't need to set
> anything (only the class loader hierarchy correctly). When you set the
> bootdelegation, you don't need to import the package in the bundles
> which are using it.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02021 seconds