Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Launch Eclipse App with OSGi-Service
Launch Eclipse App with OSGi-Service [message #99327] Fri, 05 October 2007 12:39 Go to next message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

Hello,
I use ".launch" files to launch Eclipse RCP Applications from within
Eclipse. Launching Eclipse RCP apps works flawless. The problem is, I also
want to start an Equinox service "plugin" with the launcher. This works
flawless and easy if I start an OSGi Framework. But I want to start an
Eclipse RCP application which uses OSGi services.

Two examples to make it clear:
First:
- I start an "Eclipse Application" from within Eclipse.
- Works flawless. Except the OSGi service doesn't get started. Its
overwritten .start and .stop methods are never entered. Even its
constructor is never called.
-> This is the target: Launching an already existing Eclipse RCP Application
with my OSGi service.

Second:
- I start an "OSGi Framework" (Equinox).
- My service gets started. Its methods .start (and later .stop) are called.
- The Equinox console opens, where I can input commands (like "ss" for
plugin/bundle states).
-> This is __not__ the target. I want a classic Eclipse RCP Application. But
with new selfmade OSGi services _and_ already existing plugins.

I tried already launching it as an application _and_ a product. I already
added "-Dosgi.framework.extensions=myextensionpackage" to the arguments.
But it didn't work.
Oh, and Eclipse tells me everytime in the "Plugin-Details" Dialog that the
bundle itself has been loaded!

Has anyone an idea how I start OSGi services with an Eclipse launcher in
an Eclipse Application configuration?
Thanks,
Jan Diederich
Re: Launch Eclipse App with OSGi-Service [message #99390 is a reply to message #99327] Fri, 05 October 2007 22:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

Same way as in an OSGi app. The bundle will only get started when the classes are accessed; so if nothing accesses them, they won't start. (This assumes you have Bundle-ActivationPolicy: lazy in the manifest.) The alternative is to add the bundle to the osgi.bundles property to start it up when the Eclipse instance starts.

Alex.
Re: Launch Eclipse App with OSGi-Service [message #99436 is a reply to message #99390] Mon, 08 October 2007 10:11 Go to previous message
Eclipse UserFriend
Originally posted by: Jan-Hendrik.Diederich.bredex.de

Alex Blewitt wrote:
> Same way as in an OSGi app. The bundle will only get started when the
classes are accessed; so if nothing accesses them, they won't start. (This
assumes you have Bundle-ActivationPolicy: lazy in the manifest.) The
alternative is to add the bundle to the osgi.bundles property to start it up
when the Eclipse instance starts.

Thanks for the answer. But I have already tried it with disabled Lazy
Activation. It makes no difference. And if I set the OSGi property
"osgi.bundles=mybundle" my plugin gets activated but I have another
problem. The needed basic bundles including "osgi.eclipse.core.runtime"
aren't loaded. Even if I add them
(osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start,myplugin@start),
it won't work. Then it tells me it can't find them. Example:
"
!ENTRY org.eclipse.osgi 4 0 2007-10-08 11:57:52.945
!MESSAGE Bundle org.eclipse.update.configurator@3:start not found.
"
And without start-level and method:
"!MESSAGE Bundle org.eclipse.update.configurator not found."

Although the Eclipse dependency checker put them correctly in the
"included plugins" list of the launcher configuration.


Thanks for any ideas,
Jan Diederich
Previous Topic:Is ServiceTracker#addingService called asynchronously ?
Next Topic:Output stopped on Windows XP
Goto Forum:
  


Current Time: Thu Apr 25 23:34:46 GMT 2024

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

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

Back to the top