Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » My osgi.framework.extensions got deleted from the config.ini by eclipse
My osgi.framework.extensions got deleted from the config.ini by eclipse [message #511727] Tue, 02 February 2010 16:33 Go to next message
Raymond Mising name is currently offline Raymond Mising name
Messages: 59
Registered: July 2009
Member
This post was transfered from the P2 forum because no one answered it druing a long time.

Our plug-in extends osgi.framework.extensions. In our plug-in installer
which contains both our plug-in and eclipse 3.5, we managed to add a line
"osgi.framework.extensions=net.xxx.xxx.hook" to the config.ini file, so
users do not need to manually add it. However, after the first time
eclipse starts up, our hook was removed. The config.ini has a line on the
top saying:
"#This configuration file was written by:
org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxF wConfigFileParser "
If we manually add it back, and then our hook works. It seem when eclipse
starts up for the first time, it checks something. Can anyone tell me how
to solve this problem? Everything worked fine in 3.4.

Recently, I found everytime I installed a new plug-in from a update site, the configure.ini file got re-written and my hook configuration got removed.

Thanks.
Re: My osgi.framework.extensions got deleted from the config.ini by eclipse [message #511742 is a reply to message #511727] Tue, 02 February 2010 17:07 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 427
Registered: July 2009
Senior Member
I imagine this has something to do with the framework extensions support added to p2 in 3.5 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=241477).

Is your framework extension installed using p2? If so you should not have to edit the config.ini at all. p2 should do that for you automatically. You should probably comment in the bug above or it would probably be better to open a new bug against p2 with steps to reproduce.

Tom.
Re: My osgi.framework.extensions got deleted from the config.ini by eclipse [message #512113 is a reply to message #511727] Wed, 03 February 2010 23:15 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana Peco
Messages: 789
Registered: July 2009
Senior Member
You should create your hook bundle as a fragment of the system bundle (org.eclipse.osgi).
P2 regenerates the osgi.framework.extensions property and adds all the fragments of the system bundle to it.
MANIFEST.MF of your hook would be similar to the following:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: <your_hook_symbolic_name>
Bundle-Version: <hook_version>
Fragment-Host: org.eclipse.osgi;bundle-version="[3.2.0,4.0.0)"
....

Snjeza

Raymond wrote:
> This post was transfered from the P2 forum because no one answered it
> druing a long time.
>
> Our plug-in extends osgi.framework.extensions. In our plug-in installer
> which contains both our plug-in and eclipse 3.5, we managed to add a
> line "osgi.framework.extensions=net.xxx.xxx.hook" to the config.ini
> file, so users do not need to manually add it. However, after the first
> time eclipse starts up, our hook was removed. The config.ini has a line
> on the top saying:
> "#This configuration file was written by:
> org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxF
> wConfigFileParser "
> If we manually add it back, and then our hook works. It seem when
> eclipse starts up for the first time, it checks something. Can anyone
> tell me how to solve this problem? Everything worked fine in 3.4.
> Recently, I found everytime I installed a new plug-in from a update
> site, the configure.ini file got re-written and my hook configuration
> got removed.
> Thanks.
Re: My osgi.framework.extensions got deleted from the config.ini by eclipse [message #512390 is a reply to message #512113] Thu, 04 February 2010 21:50 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising name
Messages: 59
Registered: July 2009
Member
Thanks for the replys. I will give it a try. Smile
Re: My osgi.framework.extensions got deleted from the config.ini by eclipse [message #512643 is a reply to message #511727] Fri, 05 February 2010 18:11 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising name
Messages: 59
Registered: July 2009
Member
Snjeza, I am a newbie of fragment development. I could not make the fragment work. Followed your suggestion, I created a fragment for the hook against the osgi bundle and also added a hookconfigurator.properties file which has the configuration of the hook class:
hook.configurators=XXX.XXX.XXX.MyCassLoadingHook. I set a breakpoint at the org.eclipse.osgi.baseadaptor.initialize() method. When I launched eclipse, I did not see my hook got initialized. Is there any thing else needs to be configured when launching an eclipse application? Thanks.
Re: My osgi.framework.extensions got deleted from the config.ini by eclipse [message #512654 is a reply to message #511727] Fri, 05 February 2010 19:36 Go to previous message
Raymond Mising name is currently offline Raymond Mising name
Messages: 59
Registered: July 2009
Member
To be more specific, when I implemented my original hook plug-in, I followed the instruction of the following article and it worked very well except the issue I discribed in my first post. Link of the article:
http://www.eclemma.org/research/instrumentingosgi/index.html

This time, I changed my hook plug-in into a osgi fragment. When I launched an eclipse application, if I did not add an argument :-Dosgi.framework.extensions=XXX.XXX.XXX.myHook, I did not see my hook got registered. If I passed in that argument, I saw my hook was registered but got an error later on saying:

!MESSAGE Error installing bundle: reference:file:E:/P4/main/EclipsePlugin/net.rim.ejde.preproc essing.hook/
!STACK 0
org.osgi.framework.BundleException: Extension bundle fragments cannot specify a Require-Bundle header: initial@reference :file:E:/P4/main/EclipsePlugin/net.rim.ejde.preprocessing.ho ok/
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.validateEx tension(BaseStorage.java:954)
......
I looked into the BaseStorage
.validateExtension() code and found it did not allow my fragment having any required bundle. But my hook does need org.eclipse.core.resources and org.eclipse.core.runtime.

Any idea?

Thanks.
Previous Topic:Equinox director application--->against--->legacy update site
Next Topic:Access restriction on bundles
Goto Forum:
  


Current Time: Sun Sep 21 06:04:32 GMT 2014

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

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