| Summary: | SecurityException on starting bundle, uses a BundleTracker or BundleTracker Customizer | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Virgo | Reporter: | marcel.hanser | ||||
| Component: | unknown | Assignee: | Glyn Normington <glyn.normington> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | glyn.normington, tjwatson | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.1.0.M05-incubation | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
marcel.hanser
At first I thought this was related to bug 173673. I now realize this is an issue with loading a class from the org.osgi.util.tracker package. This package is exported by the system bundle and should be loaded by the "root" framework's class loader. In this case we have the root framework being loaded by sun.misc.Launcher$AppClassLoader (app class loader) and some virgo region being loaded by org.eclipse.osgi.launch.EquinoxFWClassLoader. As you can see from the stack track org.eclipse.osgi.launch.EquinoxFWClassLoader is delegating to sun.misc.Launcher$AppClassLoader for the BundleTrackerCustomizer class. What is strange is that all the other classes in the org.osgi.util.tracker package should have also been loaded by the sun.misc.Launcher$AppClassLoader class loader. Is there some other jar on the app class path that may have a subset of the org.osgi.util.tracker package? Is that jar ahead of the org.eclipse.osgi.jar on the app class path? Thanks for that Tom. Marcel: If you are using Virgo "out of the box" then there are unlikely to be any other JARs supplying classes of the org.osgi.util.tracker package unless you have configured your JVM to add such JARs before launching Virgo. Please could you confirm the set up? Also it would be very helpful if you could attach a binary bundle to this bug which can be used to reproduce the problem. Hi Thomas, Glyn,
thank you very much for your fast responses.
Yes, I'm using a "out of the box" virgo version
"virgo-kernel-2.1.0.M04-incubation". I just create a folder called pickup in the root folder and pasting the (now) attached file to reproduce the exception. The bundle just includes following Activator class:
package de.test.bundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.BundleTracker;
/**
* <code>Activator</code>TODO - [imm0217], please write javadoc for class 'Activator'!
*
* @author Marcel Hanser [imm0217]
*/
public class Activator implements BundleActivator
{
private BundleTracker tracker;
public void start( BundleContext context ) throws Exception
{
tracker = new BundleTracker( context, Bundle.ACTIVE, null );
}
public void stop( BundleContext context ) throws Exception
{
// TODO Auto-generated method stub
}
}
Created attachment 180059 [details]
bundle to reproduce the SecurityException
I followed your instructions on an up to date kernel and your test bundle deployed normally with no exceptions: [2010-10-01 16:18:58.407] fs-watcher <HD0001I> Hot deployer processing 'INITIAL' event for file 'de.test.bundle-1.0.0.jar'. [2010-10-01 16:18:58.448] fs-watcher <DE0000I> Installing bundle 'de.test.de.test.bundle' version '1.0.0'. [2010-10-01 16:18:58.464] fs-watcher <DE0001I> Installed bundle 'de.test.de.test.bundle' version '1.0.0'. [2010-10-01 16:18:58.474] fs-watcher <DE0004I> Starting bundle 'de.test.de.test.bundle' version '1.0.0'. [2010-10-01 16:18:58.483] start-signalling-1 <DE0005I> Started bundle 'de.test.de.test.bundle' version '1.0.0'. I checked the status of the bundle and it is ACTIVE. What JVM are you using? BTW we fixed the bug about there being no empty pickup directory provided in the kernel zip. I tried again on milestone 4 of the kernel and your problem reproduces. I am wondering if the upgrade to Equinox 3.6.1 may have fixed the problem as it was a pretty significant upgrade. Anyway, it seems sorted now, so closing off. You should re-test when we issue RC1, but the problem should have gone. |