OSGI install and start plugin in runtime HELP [message #284599] |
Wed, 27 April 2005 12:32  |
Eclipse User |
|
|
|
Hi all,
it is possible to install and start external plugins with remote OSGi
console. (install and start commands)
I need the same funktionality, but in the runtime. There is an interface
BundleContext for that, could you please give me a piece of advice how
do I get the instance of that in my workbench environment?
Thanks a lot,
Ilya
|
|
|
|
Re: OSGI install and start plugin in runtime HELP [message #284659 is a reply to message #284624] |
Thu, 28 April 2005 06:55   |
Eclipse User |
|
|
|
Hi Sven,
thank you for the hint.
Nevertheless, I still have the following problem: when I try to install
the plugin (doesn't matter how - with console or programmaticaly) I got
the following error (please see the stacktrace below, it's rather long).
The directory
D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
loader\org.eclipse.osgi\bundles\ is empty, there are no subdurs neither
files in it.
Any ideas?
org.osgi.framework.BundleException: Error converting plugin at
D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:236)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
at
org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
at
org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
at java.lang.Thread.run(Thread.java:534)
Caused by:
org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
Could not find a plugin.xml or a fragment.xml in
D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
... 22 more
Nested Exception:
org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
Could not find a plugin.xml or a fragment.xml in
D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
at
org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
at
org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
at java.lang.Thread.run(Thread.java:534)
Nested Exception:
org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
Could not find a plugin.xml or a fragment.xml in
D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
at
org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
at
org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
at
org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
at
org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
at
org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
at java.lang.Thread.run(Thread.java:534)
Sven Schulz wrote:
> Hi Ilya,
>
> I think you can access a BundleContext instance within the lifecycle
> methods (start/stop) of a bundle activator (defined in the Manifest.mf,
> may be an extension of the Plugin class). But be careful! If I remember
> right, this instance is only valid within these methods.
>
> Hope this helps.
>
> Regards,
> Sven Schulz
>
> Ilya Shinkarenko wrote:
>
>> Hi all,
>>
>> it is possible to install and start external plugins with remote OSGi
>> console. (install and start commands)
>>
>> I need the same funktionality, but in the runtime. There is an
>> interface BundleContext for that, could you please give me a piece of
>> advice how do I get the instance of that in my workbench environment?
>>
>> Thanks a lot,
>> Ilya
|
|
|
Re: OSGI install and start plugin in runtime HELP [message #284720 is a reply to message #284659] |
Fri, 29 April 2005 05:25  |
Eclipse User |
|
|
|
The problem is solved - the solution is to export plugins, which are to
be istalled, as a "Individual jar archive for update site". Why does it
not function with zip or directory structure exported plugins - not
clear, seems like an eclipse bug :-(
Ilya Shinkarenko wrote:
> Hi Sven,
>
> thank you for the hint.
>
> Nevertheless, I still have the following problem: when I try to install
> the plugin (doesn't matter how - with console or programmaticaly) I got
> the following error (please see the stacktrace below, it's rather long).
>
> The directory
> D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
> loader\org.eclipse.osgi\bundles\ is empty, there are no subdurs neither
> files in it.
>
> Any ideas?
>
>
> org.osgi.framework.BundleException: Error converting plugin at
> D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
> loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:236)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
>
> at java.lang.Thread.run(Thread.java:534)
> Caused by:
> org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
> Could not find a plugin.xml or a fragment.xml in
> D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
> loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
>
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
>
> ... 22 more
> Nested Exception:
> org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
> Could not find a plugin.xml or a fragment.xml in
> D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
> loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
>
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
>
> at java.lang.Thread.run(Thread.java:534)
> Nested Exception:
> org.eclipse.osgi.service.pluginconversion.PluginConversionEx ception:
> Could not find a plugin.xml or a fragment.xml in
> D:\dev\eclipse3\workspace\.metadata\.plugins\org.eclipse.pde .core\OSGI
> loader\org.eclipse.osgi\bundles\12\1\admin-editor.zip.
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.fillPlu ginInfo(PluginConverterImpl.java:110)
>
> at
> org.eclipse.core.runtime.adaptor.PluginConverterImpl.convert Manifest(PluginConverterImpl.java:660)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.generateM anifest(EclipseBundleData.java:233)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadManif est(EclipseBundleData.java:191)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.getManife st(EclipseBundleData.java:159)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseBundleData.loadFromM anifest(EclipseBundleData.java:280)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultBu ndleData.initializeNewBundle(DefaultBundleData.java:77)
>
> at
> org.eclipse.osgi.framework.internal.defaultadaptor.DefaultAd aptor$1.begin(DefaultAdaptor.java:472)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rkerPrivileged(Framework.java:746)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework$1.run(Fra mework.java:635)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.Framework.installWo rker(Framework.java:715)
>
> at
> org.eclipse.osgi.framework.internal.core.Framework.installBu ndle(Framework.java:630)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.i nstallBundle(BundleContextImpl.java:198)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._install(FrameworkCommandProvider.java:280)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:139)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:292)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:277)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:236)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:207)
>
> at java.lang.Thread.run(Thread.java:534)
>
>
>
>
>
>
> Sven Schulz wrote:
>
>> Hi Ilya,
>>
>> I think you can access a BundleContext instance within the lifecycle
>> methods (start/stop) of a bundle activator (defined in the
>> Manifest.mf, may be an extension of the Plugin class). But be careful!
>> If I remember right, this instance is only valid within these methods.
>>
>> Hope this helps.
>>
>> Regards,
>> Sven Schulz
>>
>> Ilya Shinkarenko wrote:
>>
>>> Hi all,
>>>
>>> it is possible to install and start external plugins with remote OSGi
>>> console. (install and start commands)
>>>
>>> I need the same funktionality, but in the runtime. There is an
>>> interface BundleContext for that, could you please give me a piece of
>>> advice how do I get the instance of that in my workbench environment?
>>>
>>> Thanks a lot,
>>> Ilya
|
|
|
Powered by
FUDForum. Page generated in 0.03457 seconds