My osgi.framework.extensions got deleted from the config.ini by eclipse [message #511727] |
Tue, 02 February 2010 11:33  |
Eclipse User |
|
|
|
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 #512113 is a reply to message #511727] |
Wed, 03 February 2010 18:15   |
Eclipse User |
|
|
|
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 #512654 is a reply to message #511727] |
Fri, 05 February 2010 14:36  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.23873 seconds