Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » P1 blocker bug with loading of OSGi Extensions
P1 blocker bug with loading of OSGi Extensions [message #99858] Tue, 16 October 2007 13:24 Go to next message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

Hi,
I think I've found a big bug with the loading of OSGi Extensions. Although
I define "-Dosgi.framework.extensions=myextension" as a JavaVM argument,
or write "osgi.framework.extensions=myextension" directly in the
configuration/config.ini file, my extension isn't in the classpath. At
least not at that time when all "hookconfigurators.properties" files are
loaded.
I think this is a bug. The self-written startup classLoader doesn't get
the right classpaths.
Here is the code from HookRegistry which handles the Hook loading:

private void mergeFileHookConfigurators(ArrayList configuratorList,
ArrayList errors) {
ClassLoader cl = getClass().getClassLoader();
// get all hook configurators files in your classloader delegation
Enumeration hookConfigurators;
try {
hookConfigurators = cl != null
// Here it fails! My extension has this file, but the properties file
doesn't make it in the list:
? cl.getResources(HookRegistry.HOOK_CONFIGURATORS_FILE)
: ClassLoader.
getSystemResources(HookRegistry.HOOK_CONFIGURATORS_FILE);
} catch (IOException e) { ... return; }

If I add it manually, and handle later the actual loading of the file by
myself, everything works fine.
I use mainly eclipse 3.3.0, but tested also 3.3.1 and saw no difference.

I think this needs to be fixed and posted as a "P1, Blocker" - Bug.
Jan Diederich
Re: P1 blocker bug with loading of OSGi Extensions [message #99887 is a reply to message #99858] Tue, 16 October 2007 14:29 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Could you log a bug and attach any resources to help create a test case.
Thanks.

-Simon
"Jan Diederich" <Jan-Hendrik.Diederich@bredex.de> wrote in message
news:9158a0f52373c513fe4dc84e3ffcf97c$1@www.eclipse.org...
> Hi,
> I think I've found a big bug with the loading of OSGi Extensions. Although
> I define "-Dosgi.framework.extensions=myextension" as a JavaVM argument,
> or write "osgi.framework.extensions=myextension" directly in the
> configuration/config.ini file, my extension isn't in the classpath. At
> least not at that time when all "hookconfigurators.properties" files are
> loaded.
> I think this is a bug. The self-written startup classLoader doesn't get
> the right classpaths.
> Here is the code from HookRegistry which handles the Hook loading:
>
> private void mergeFileHookConfigurators(ArrayList configuratorList,
> ArrayList errors) {
> ClassLoader cl = getClass().getClassLoader();
> // get all hook configurators files in your classloader delegation
> Enumeration hookConfigurators;
> try {
> hookConfigurators = cl != null
> // Here it fails! My extension has this file, but the properties file
> doesn't make it in the list:
> ? cl.getResources(HookRegistry.HOOK_CONFIGURATORS_FILE)
> : ClassLoader.
> getSystemResources(HookRegistry.HOOK_CONFIGURATORS_FILE);
> } catch (IOException e) { ... return; }
>
> If I add it manually, and handle later the actual loading of the file by
> myself, everything works fine.
> I use mainly eclipse 3.3.0, but tested also 3.3.1 and saw no difference.
>
> I think this needs to be fixed and posted as a "P1, Blocker" - Bug.
> Jan Diederich
>
Re: P1 blocker bug with loading of OSGi Extensions [message #99946 is a reply to message #99887] Wed, 17 October 2007 09:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

Yes, I will create a simple straightforward test. But logging makes no
sense since the problem is that _nothing_ happens!

Simon Kaegi wrote:

> Could you log a bug and attach any resources to help create a test case.
> Thanks.
Re: P1 blocker bug with loading of OSGi Extensions [message #99961 is a reply to message #99887] Wed, 17 October 2007 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

I created a bug-report under:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206611

Of course with no log-output. Since the failure is that _nothing_ happens.
Re: P1 blocker bug with loading of OSGi Extensions [message #99976 is a reply to message #99858] Wed, 17 October 2007 13:14 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Jan,

How are you launching the framework? Are you using the eclipse.exe or
the org.eclipse.equinox.launcher.jar? Or are you just using java -jar
org.eclipse.osgi.jar? If it is the latter then the
osgi.framework.extensions property is not being processed. This
property gets processed by the launcher (org.eclipse.equinox.launcher)
which sets up the classloader for the framework and adds any specified
framework extensions. Extensions which provide framework hooks must be
included on the classpath of the framework before the framework is invoked.

Tom.
Re: P1 blocker bug with loading of OSGi Extensions [message #99992 is a reply to message #99961] Wed, 17 October 2007 14:33 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
From the bug report
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=206611), the workaround
is to rename your framework extension jar to include the bundle-version.
For example, add _1.0.0 to the jar name.

org.eclipse.equinox.hookBug_1.0.0.jar

HTH

Tom.
Re: P1 blocker bug with loading of OSGi Extensions [message #100005 is a reply to message #99992] Thu, 18 October 2007 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

Tom Watson wrote:
> For example, add _1.0.0 to the jar name.
> org.eclipse.equinox.hookBug_1.0.0.jar

Great, that seems to work smoothly.
I edited the wiki entry about Adapter Hooks and mentioned the bug, so that
others will not run into the same problem.

Thanks,
Jan
Re: P1 blocker bug with loading of OSGi Extensions [message #100018 is a reply to message #99858] Thu, 18 October 2007 09:31 Go to previous message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

I don't get it: How do you use your extension in a launcher configuration?
I renamed my project already to "myproject_1.0.0.0", but it's ignored. I
think also this isn't necessary. How must the launcher be configured to
launch an Eclipse-RCP-with-OSGi-Extension Product?

Thanks for any answers,
Jan
Previous Topic:Ordering of results from ObjectClassDefinition.getAttributeDefinitions()?
Next Topic:java.lang.OutOfMemoryError: PermGen space
Goto Forum:
  


Current Time: Fri Apr 26 00:14:11 GMT 2024

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

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

Back to the top