Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] org.osgi.framework.bootdelegation not working?

The org.osgi.framework.bootdelegation property is used to list packages that should be boot delegated. Setting it to "true" only boot delegates for classes in the "true" package. You indicated that you have tried to use the actual package name so that is not the only issue for getting this to work. To launch the framework you are using the following command line:

java -cp org.eclipse.osgi_3.6.2.R36x_v20110210.jar:bootclasses.jar \

The issue is that you are placing the bootclasses.jar on the application class loader along with the org.eclipse.osgi jar. This is not the boot class loader. Bundle class loaders are not by default parented by the application class loader. They are parented by the boot class loader. You will need to place you jar on the boot class path of the VM (with some VM specific setting) or another option is to use a framework configuration property to cause the bundle class loader parent to be the application class loader with the option org.osgi.framework.bundle.parent=boot. The following should work:

java -cp org.eclipse.osgi_3.6.2.R36x_v20110210.jar:bootclasses.jar \



Inactive hide details for Bruce Bohannan ---04/11/2011 01:32:42 AM---I am trying to get eclipse-osgi running in a standalone jaBruce Bohannan ---04/11/2011 01:32:42 AM---I am trying to get eclipse-osgi running in a standalone java program and am having problems with getting bootclass delegation t


Bruce Bohannan <bbohannan@xxxxxxxxx>




04/11/2011 01:32 AM


[eclipse-dev] org.osgi.framework.bootdelegation not working?

I am trying to get eclipse-osgi running in a standalone java program and am having problems with getting bootclass delegation to work.

I have a simple example, with a bootclasses.jar with one class in it ("com.rsc.nonBundle.Bob").

The tinkertoy class is

package com.rsc.nonBundle;

 * class example to be put on the classpath, not in a bundle
public class Bob
   public Bob()

I  have s simple OSGI plugin which runs fine.  When I add this to my derived BundleActivator's start() method

        // look for a class on the system class path

           Bob bob = new Bob();

start() found non-bundle class");
        catch(Throwable e)
           System.out.println("Activator.start() didn't find non-bundle class");

then it starts throwing a ClassNotFound exception.

I've tried to run it with org.osgi.framework.bootdelegation defined to true

java -cp org.eclipse.osgi_3.6.2.R36x_v20110210.jar:bootclasses.jar \

Here is the stack trace:

     [java] Activator Start
     [java] In Factory Accessor
     [java] In Factory Accessor returning: com.rsc.vtk.impl.fragment2.Fragment2Factory@28bb0d0d
     [java] In getMessage
     [java] com.vividsolutions.jts.JTSVersion
     [java] Activator.start() didn't find non-bundle class
     [java] java.lang.NoClassDefFoundError: com/rsc/nonBundle/Bob
     [java]     at
     [java]     at org.eclipse.osgi.framework.internal.core.BundleContextImpl$
     [java]     at Method)
     [java]     at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(
     [java]     at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
     [java]     at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
     [java]     at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(
     [java]     at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(
     [java]     at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(
     [java]     at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(
     [java]     at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(
     [java]     at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(
     [java]     at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(
     [java]     at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(
     [java]     at org.eclipse.osgi.framework.eventmgr.EventManager$
     [java] Caused by: java.lang.ClassNotFoundException: com.rsc.nonBundle.Bob
     [java]     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
     [java]     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
     [java]     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
     [java]     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
     [java]     at java.lang.ClassLoader.loadClass(
     [java]     ... 15 more

I have experimented with setting osgi.compatibility.bootdelegation=false and org.osgi.framework.bootdelegation=* to no avail.

I've tried org.osgi.framework.system.packages=com.rsc.nonBundle to no avail.

I'm running with a newish copy of org.eclipse.osgi.jar (org.eclipse.osgi_3.6.2.R36x_v20110210.jar)

I'm sure I'm doing something wrong: Der Google does not show many hits on this property not working.

Any help would be appreciated.

eclipse-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

GIF image

GIF image

Back to the top