Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 106395 - Need a pretty OSGi App launcher
Summary: Need a pretty OSGi App launcher
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M3   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 106188
  Show dependency tree
 
Reported: 2005-08-08 14:55 EDT by Thomas Watson CLA
Modified: 2005-10-04 09:38 EDT (History)
5 users (show)

See Also:


Attachments
simple hello world product (3.07 KB, application/octet-stream)
2005-08-08 14:59 EDT, Thomas Watson CLA
no flags Details
New launcher (75.30 KB, image/gif)
2005-09-19 16:13 EDT, Wassim Melhem CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2005-08-08 14:55:57 EDT
Not sure if this is a PDE build or UI problem (or user error).

I want to create a product using only OSGi (org.eclipse.osgi) and a 
simple "Hello World" bundle.  I started with a very simple plug-in project 
that has one class for its BundleActivator.  The BundleActivator simply 
prints "Hello World!!" to the console (how creative :)

Now I want to create a product which includes my bundle and starts it each 
time I launch the product.  I created a new "Product Configuration".  I then 
used the following steps

- product configuration editor is opened.
- I must pick an existing Product ID or create a new one.  I created a new one.
- I choose my simple hello world bundle as the defining plug-in.
- This forces me to choose an application (but I don't really want 
an "eclipse" application here, so I just used the default 
org.eclipse.ant.core.antRunnter)
- I'm not sure if this is by design or a bug but after that I was able to 
select an empty "" application in the dropdown box.  I ended up with a Product 
ID but no Application or Product Name specified.
- I then added org.eclipse.osgi and org.eclipse.osgi.helloworld plugins to the 
list of plug-ins that constitute the product.
- I then created my own config.ini for the product using the following content
#Product Runtime Configuration File
osgi.bundles=org.eclipse.osgi.helloworld@2:start
osgi.bundles.defaultStartLevel=4
eclipse.ignoreApp=true

After this I was able to launch the product using the "Launch the product" 
link on the product configuration editor.  But each time I launch the product 
it forces a plugin.xml file to be created in my hello world plug-in project.

I will attach my hello world bundle with no plugin.xml file.
Comment 1 Thomas Watson CLA 2005-08-08 14:59:52 EDT
Created attachment 25861 [details]
simple hello world product

Open the /org.eclipse.osgi.helloworld/helloworld.product file and click on the
"Launch the product" link.  Notice a new plugin.xml file gets created in the
helloworld project.
Comment 2 Wassim Melhem CLA 2005-08-18 08:36:14 EDT
Tom,

a new plugin.xml is created for your plugin by PDE because we have to generate 
an org.eclipse.core.runtime.products extension in your plugin.xml that 
corresponds to the one you declared in the .product file.  

Is there more to the story or does that answer your question?

Comment 3 Thomas Watson CLA 2005-08-18 09:05:47 EDT
This is related to plan item bug 106188.

I was investigating how tools would react to a target that only included 
org.eclipse.osgi.  In this scenario there is no core.runtime and therefore no 
extension registry.  It is strange to have a org.eclipse.core.runtime.products 
extension in this situation.  We will likely need some enhancements to both 
tools and osgi to make launching a standalone osgi framework easier for 
development and deployment.

The good news is things almost work today as is.  But I would prefer OSGi to 
have a "first class" launcher similar to the "Eclipse Application" launcher.  
Maybe something like "OSGi Application".  This launcher would allow you to 
specify a set of bundles from the target and workspace and allow you to set 
the startlevel and start status (PDE used to have something like this at one 
point on the configuration tab).  This information would be stored in the 
osgi.bundles property of the config.ini.  

This launcher would also not require you to pick an Eclipse application or 
product.  An Eclipse application or product implies that your target has 
core.runtime.  If that is the case then you would just use the 
regular "Eclipse Application" launcher.
Comment 4 Wassim Melhem CLA 2005-08-18 09:20:47 EDT
Now I understand why you didn't want to associate an application with your 
product.

So there is no bug in the product editor.  It just doesn't (and was not meant 
to) support the pure OSGi story you want. 

Let's use this bug report to track the request for an OSGi application 
launcher. 

I will rename the bug report accordingly.
Comment 5 Thomas Watson CLA 2005-08-19 18:22:29 EDT
More details on what I would like to see in an OSGi Launcher.

Main Tab
  - No need for "Workspace Data"
  - No need for "Program to Run"
  - Keep "Command Line Settings"

Plug-ins Tab
  - Keep as is

Configuration Tab
  - Keep as is, but it would be nice if the "Generate a config.ini file with 
default content" option would generate a proper config.ini which started all 
the bundles selected and set some additional properties needed to run osgi 
standalone.  
  - Today if you don't have update.configurator selected in your choosen 
plugins then PDE will generate a config.ini with an osgi.bundles property 
which lists all the bundles selected.  The OSGi Launcher would do the same 
thing except it would have a optional checkbox to start all the bundles in the 
target.  I think this checkbox should be enabled by default in the OSGi 
Launcher.  When checked the osgi.bundles property would contain bundle ids in 
the following form:
  <symbolic name>@4:start
The generated config.ini would also have the following properties set:
  osgi.bundles.defaultStartLevel=4
  eclipse.ignoreApp=true
  osgi.noShutdown=true

Tracing Tab
  - Keep as is

Environment Tab
  - Keep as is

Source Tab
  - Keep as is

Common Tab
  - Keep as is
Comment 6 Wassim Melhem CLA 2005-09-19 16:13:44 EDT
Created attachment 27270 [details]
New launcher

The new launcher is almost finished.  It won't be in for M2, as
persisting/restoring the new Plug-ins tab is pretty challenging.

Here is a sneak preview.  It is so pretty.
Tom, did I miss anything esthetically?
Comment 7 Pascal Rapicault CLA 2005-09-19 16:34:35 EDT
I would qualify this one of gorgeous
Comment 8 Thomas Watson CLA 2005-09-19 16:45:06 EDT
Looking good.  I would recommend you replace the term "auto-start" with the 
new and improved "lazy-start" term.

I assume the arguments and jre tabs are the standard Java application launcher 
tabs for specifying the JRE, VM arguments, program arguments etc.  Is the 
Eclipse application launcher also going to use these standard Java application 
tabs? or is it going to still place this information on the old Main tab?
Comment 9 Wassim Melhem CLA 2005-09-19 16:51:05 EDT
Now I am confused.

I thought Auto-Start in this context referred to the @2:start in the 
config.ini, which is different from the Eclipse-LazyStart found in the 
manifest.mf???

The Eclipse Application launcher started using the standard Program Arguments 
tab as of today's builds.  Check it out We now also support variable 
substitutions, etc. in our PDE launchers. 
The JRE tab is our own, because we still want people to modify the boot 
classpath.  If were to use the JDT ones, we end up with two new tabs, one of 
which would be misleading for Eclipse/Equinox purposes.
Comment 10 Thomas Watson CLA 2005-09-19 17:21:22 EDT
Ahhh!!  this is why the Eclipse-AutoStart header was such a bad name ;-)

Wassim, you are correct auto-start in this context indicates if the bundle 
should be started (by using @2:start in the config.ini).  I understand it 
now.  Sorry for the confusion.
Comment 11 Wassim Melhem CLA 2005-09-27 00:14:03 EDT
ok, the launcher will be in tomorrow's I-build.

Tom, give it a whirl.
Comment 12 Gunnar Wagenknecht CLA 2005-09-27 06:30:29 EDT
(In reply to comment #6)
> Created an attachment (id=27270) [edit]
> New launcher

> Here is a sneak preview.  It is so pretty.
> Tom, did I miss anything esthetically?

IMHO the tab "Plug-ins" is confusing. It should be renamed to "Bundles". That's
what we are dealing with in the OSGi world. 

BTW, is there a separate project nature for pure OSGi bundles that arn't
plug-ins? If yes those projects should be also visible in this tab.
Comment 13 Wassim Melhem CLA 2005-09-27 09:29:05 EDT
>is there a separate project nature for pure OSGi bundles that arn't
>plug-ins?

plugin == bundle.  That is how it has always been in Eclipse.
What in your opinion distinguishes a "pure OSGi bundle" from a "plug-in"?
Comment 14 Gunnar Wagenknecht CLA 2005-09-27 11:58:47 EDT
(In reply to comment #13)
> >is there a separate project nature for pure OSGi bundles that arn't
> >plug-ins?
> 
> plugin == bundle.  That is how it has always been in Eclipse.
> What in your opinion distinguishes a "pure OSGi bundle" from a "plug-in"?

I just meant to say that in the OSGi world the term "plug-in" is unknown. In
Eclipse a plug-in is a bundle but in OSGi only bundles exists. Thus, if you want
to give OSGi a first class presence you are attracting OSGi users not familar
with the term "plug-in" (if they don't know anything about the Eclipse
architecture).
Comment 15 Jeff McAffer CLA 2005-10-04 09:38:32 EDT
Understood but the distinction is entirely artificial.  Wassim's question is 
right on.  When/how would PDE decide to use "plugin" vs. "Bundle"?  There is 
no cue because they are the same thing.  One thing we might do is make the new 
wizard label be something like New Plug-in/Bundle project so that OSGi focused 
people are attracted to the function.