Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314619 - [patch] org.eclipse.equinox.app is not started when using Eclipse Application launcher
Summary: [patch] org.eclipse.equinox.app is not started when using Eclipse Application...
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 04:53 EDT by Gunnar Wagenknecht CLA
Modified: 2019-09-13 11:58 EDT (History)
5 users (show)

See Also:


Attachments
patch for starting equinox.app bundle (9.14 KB, patch)
2010-05-31 04:01 EDT, Gunnar Wagenknecht CLA
no flags Details | Diff
smaller patch (949 bytes, patch)
2010-06-07 09:58 EDT, Darin Wright CLA
no flags Details | Diff
patch to start equinox.app only if core.runtime is not present (1.90 KB, patch)
2010-07-28 03:06 EDT, Gunnar Wagenknecht CLA
no flags Details | Diff
patch to start equinox.app if core.runtime is not present (1.87 KB, patch)
2010-11-16 08:07 EST, Gunnar Wagenknecht CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2010-05-27 04:53:47 EDT
3.6 RC1

I built a target platform by using the PDE UI "Export Product" feature exporting a product. The product itself runs fine. Note, the export also created a "repository" next to the product install. It's also important to note that the product does not contain org.eclipse.core.runtime but org.eclipse.equinox.app and the config.ini is setup to launch an application. It also contains simpleconfigurator and a bundle.info with the necessary start level for org.eclipse.equinox.app.

Now I created a fresh workspace and defined a target platform to point to the installed product on my disc. Next I created a sample bundle and an Eclipse application launch configuration. I selected the correct application but on the "Plug-ins" tab I configured "Launch with: all workspace and enabled target plug-ins".

However, PDE is unable to launch the application because the application service is not available. Inspecting the created configuration I noticed that the start level for org.eclipse.equinox.app is not correctly set in bundle.info. It's at level 4 with no auto-start set. But in the target platform it's at level 3 with auto-start set.

Thus, I think PDE does not correctly read the bundle.info from the target platform.

I also re-configured the target platform to point to the generated p2 repository but this did not help either.
Comment 1 Gunnar Wagenknecht CLA 2010-05-31 04:01:13 EDT
Created attachment 170493 [details]
patch for starting equinox.app bundle

This patch ensures that org.eclipse.equinox.app bundle is started. I also created a constant for the bundle name.
Comment 2 Gunnar Wagenknecht CLA 2010-05-31 04:02:41 EDT
This should be a 3.6.1 candidate. PDE Team please remove target milestone if you think it shouldn't.
Comment 3 Darin Wright CLA 2010-06-07 09:58:33 EDT
Created attachment 171263 [details]
smaller patch

This is a potential candidate. However, in the interest of keeping 3.6.1 fixes as small as possible, I would suggest to use the alternate patch (which is really a one line addition/change).
Comment 4 Darin Wright CLA 2010-07-27 10:30:18 EDT
I'm not familiar with the "org.eclipse.equinox.app" bundle. However, it looks like it's been part of the platform for a while. My concern is that this code will affect all launches, and if so, what would be the side effect of setting the start level of this bundle to 2, when it was historically 4?

Tom, can you shed light on this bundle?
Comment 5 Thomas Watson CLA 2010-07-27 14:39:22 EDT
(In reply to comment #4)
> I'm not familiar with the "org.eclipse.equinox.app" bundle. However, it looks
> like it's been part of the platform for a while. My concern is that this code
> will affect all launches, and if so, what would be the side effect of setting
> the start level of this bundle to 2, when it was historically 4?
> 
> Tom, can you shed light on this bundle?

If org.eclipse.core.runtime is configured to start then you should not do anything special for equinox.app.  In the case that core.runtime is set to start then you should assume core.runtime will kick the start of equinox.app.

equinox.app was created to split the application model of eclipse out of core.runtime.  It must be set to start in the absence of core.runtime.  So I don't think the simple patch is appropriate.
Comment 6 Gunnar Wagenknecht CLA 2010-07-27 14:43:23 EDT
(In reply to comment #5)
> equinox.app was created to split the application model of eclipse out of
> core.runtime.  It must be set to start in the absence of core.runtime.  So I
> don't think the simple patch is appropriate.

Why not? You already mentioned the reason that core.runtime is absence. To run Eclipse applications one doesn't need core.runtime. I think PDE should support this.
Comment 7 Thomas Watson CLA 2010-07-27 15:03:17 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > equinox.app was created to split the application model of eclipse out of
> > core.runtime.  It must be set to start in the absence of core.runtime.  So I
> > don't think the simple patch is appropriate.
> 
> Why not? You already mentioned the reason that core.runtime is absence. To run
> Eclipse applications one doesn't need core.runtime. I think PDE should support
> this.

I don't have the full context of the patch.  Does it only set the start level of equinox.app if core.runtime is NOT marked for start?  I am against marking equinox.app for start at an early start-level if core.runtime is marked for start.
Comment 8 Gunnar Wagenknecht CLA 2010-07-27 15:23:26 EDT
(In reply to comment #7)
> I don't have the full context of the patch.  Does it only set the start level
> of equinox.app if core.runtime is NOT marked for start?  I am against marking
> equinox.app for start at an early start-level if core.runtime is marked for
> start.

Ah ok. So then the patch needs a bit rework to set a start level for equinox.app only if core.runtime is not present in the launch profile.
Comment 9 Gunnar Wagenknecht CLA 2010-07-28 03:06:40 EDT
Created attachment 175370 [details]
patch to start equinox.app only if core.runtime is not present

I updated the patch to only set start level for equinox.app bundle if core.runtime is not present. I also updated the start level to "default" instead of "2" to align it with core.runtime.
Comment 10 Curtis Windatt CLA 2010-08-10 11:01:01 EDT
The latest patch is only looking at whether PDE has a model for core runtime.  If a launch config has disabled core runtime, the start level of equinox app will not be updated.  That being said, the fix would cover cases where people have a target without core runtime.

Moving to 3.7, this is not a regression and we don't have a good fix.
Comment 11 Gunnar Wagenknecht CLA 2010-11-16 08:07:21 EST
Created attachment 183218 [details]
patch to start equinox.app if core.runtime is not present

This is an update of the patch against the current HEAD. 

Can you please consider this for inclusion into 3.7 M4?
Comment 12 Jeff McAffer CLA 2010-11-16 15:51:22 EST
what is the relationship with .product files?  I'm not keen on more disconnects between whatyou can do in a .launch and a .product.  I'm all for lowering the barrier etc but would like to do so consistently.
Comment 13 Gunnar Wagenknecht CLA 2010-11-16 16:04:24 EST
(In reply to comment #12)
> what is the relationship with .product files?

There is not really a relation to .product files directly. When you have a .product file you spec start levels in there directly. This patch addresses an issue when you have a headless target platform based on a downloaded pre-build product that comes without core.runtime.

Currently, the Eclipse Application launch config does some magic in order to read start levels from the target platform and automatically start required bundles for Equinox to work correctly. However, it does so by scanning the list of available bundles for core.runtime and just set it's default auto-start to true in order to have the application service available for starting an application. Otherwise the Eclipse Application launch fails. 

But core.runtime is not the right bundle IMHO. It's necessary for backwards compatibility. The application service is in equinox.app. Therefore this must be started in order to launch an Eclipse application. 

Experienced users may know this. But PDE should be smart and aid the non-experienced users (IMO).
Comment 14 Jeff McAffer CLA 2010-11-16 17:20:23 EST
understood and agreed.  I'm thinking though that the same user shoudl have the same experience whether using a launch config or a .product.  a .product after all just ends up generating an Eclipse launch config.  It's not good to get different behaviours.  I'm not particular as to which behavior we get but would like them to be the same.
Comment 15 Gunnar Wagenknecht CLA 2010-11-17 01:51:27 EST
I see your point. The current implementation contains a lot of those smart workarounds already. Thus, today a launch is not exactly the launch represented in a .product file. Some checks would need to put in place in order to disable this behavior and rely on the .product file only.

In such a case, I wonder if the product editor needs to be enhanced in order to warn users about missing bundles that should/must be started? Otherwise a launch would fail.
Comment 16 Jeff McAffer CLA 2010-12-13 09:59:40 EST
yes, I'd like to see a warning in the .product editor that says, you've said you want to run an application but the .app bundle is not being started.

Related to comment 10, is 
  PluginRegistry.findModel(IPDEBuildConstants.BUNDLE_CORE_RUNTIME)
enough?  The runtime might be in there target but not included in the launch so the problem is still there.
Comment 17 Curtis Windatt CLA 2011-04-29 12:08:03 EDT
Bumping to 3.8 due to lack of resources.
Comment 18 Eclipse Genie CLA 2019-09-13 11:58:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.