Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » static fields at LocationManager
static fields at LocationManager [message #1219068] Sat, 30 November 2013 22:31 Go to next message
Lucas Galfaso is currently offline Lucas GalfasoFriend
Messages: 3
Registered: July 2009
Junior Member
I just encounter myself into a weird case and would like to know if this is a bug or the expected behavior.

- Create a framework using ServiceLoader
- Start this framework (do some work) stop it
- Create a new framework (again using ServiceLoader and in the same JVM), with a different FRAMEWORK_STORAGE

Equinox ignores my configuration (or at least this part of it), keeps the same location where the previous framework was installed and all the previous bundles are present. It looks like all this falls to LocationManager having a static field installLocation. Is this the expected behavior?

Regards,
Lucas
Re: static fields at LocationManager [message #1219204 is a reply to message #1219068] Mon, 02 December 2013 15:41 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 437
Registered: July 2009
Senior Member
This is not expected behavior. In Kepler, the classloader org.eclipse.osgi.launch.EquinoxFWClassLoader.EquinoxFWClassLoader is an attempt to isolate the statics in the framework implementation to allow multiple instances to exist in the same VM. But it seems that this is not working in your case.

For Luna, we have managed to get rid of all these statics that make launching multiple instances of the framework difficult. It would be good to hear if the latest I-Builds help you out.
Re: static fields at LocationManager [message #1219755 is a reply to message #1219204] Thu, 05 December 2013 16:09 Go to previous messageGo to next message
Lucas Galfaso is currently offline Lucas GalfasoFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Thomas,
Used org.eclipse.osgi_3.10.0.v20131121-1552.jar (the latest integration build) and this is the result:

If I just stop the first framework (wait for it to stop), then create a new framework and start it

Exception in thread "Framework stop" java.lang.NullPointerException
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.notifyEventHooksPrivileged(EquinoxEventPublisher.java:186)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:146)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:92)
at org.eclipse.osgi.container.Module.publishEvent(Module.java:456)
at org.eclipse.osgi.container.Module.doStop(Module.java:611)
at org.eclipse.osgi.container.Module.stop(Module.java:478)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:169)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:158)
at java.lang.Thread.run(Thread.java:724)


Now, if I want to uninstall all the bundles (as the only workaround that I found) before stopping the framework, the error is

java.lang.SecurityException: class "org.osgi.framework.ServiceObjects"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:944)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:658)
at java.lang.ClassLoader.defineClass(ClassLoader.java:786)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.framework.EquinoxBundle.createBundleContext(EquinoxBundle.java:684)
at org.eclipse.osgi.internal.framework.EquinoxBundle.getBundleContext(EquinoxBundle.java:671)
at org.eclipse.osgi.launch.Equinox.getBundleContext(Equinox.java:87)


Note: In this second case, uninstalling the bundles is performed from outside the OSGi container



Please let me know if you would like me to test something else or some other Equinox build
Re: static fields at LocationManager [message #1219785 is a reply to message #1219755] Thu, 05 December 2013 19:10 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 437
Registered: July 2009
Senior Member
Hi,

This sounds very strange. Could you open a bug and provide a test launcher that we could use to reproduce?

Thanks Tom.
Re: static fields at LocationManager [message #1219809 is a reply to message #1219785] Thu, 05 December 2013 21:43 Go to previous messageGo to next message
Lucas Galfaso is currently offline Lucas GalfasoFriend
Messages: 3
Registered: July 2009
Junior Member
Found the issue with the latest setup. The issue was that I had osgi.core-5.0.0.jar at the classpath, by removing it, both issues got solved.


BTW, org.eclipse.osgi_3.10.0.v20131121-1552.jar fixes the original issue of the static location!

Forced question: Do you know when there will be an Equinox version with the fixed marked as stable?
Re: static fields at LocationManager [message #1220245 is a reply to message #1219809] Tue, 10 December 2013 15:11 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 437
Registered: July 2009
Senior Member
The 3.10.0 version of org.eclipse.osgi will be released with the Luna release in June 2014. But the next stable milestone for the eclipse/equinox project of luna will happen at the end of this week (December 13). That will be milestone 4 (M4).

Tom.
Previous Topic:DynamicImport-Package fails
Next Topic:Webstart , equinox launcher which parameters in JNLP file
Goto Forum:
  


Current Time: Fri Dec 19 06:43:57 GMT 2014

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

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