Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311636

Summary: [publisher] Check for "branding" plugin if splash plugin not specified, and add fragments
Product: [Eclipse Project] Equinox Reporter: Kenneth Evans, Jr. <evans>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: irbull, ken, pascal
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: stalebug
Attachments:
Description Flags
ZIP file with two com.example.mail attachments. none

Description Kenneth Evans, Jr. CLA 2010-05-04 17:28:39 EDT
Build Identifier: M20090917-0800

With a simple RCP app (com.example.mail) enabled for p2, the splash screen does not appear when deployed via the Overview tab on the .product editor.  This has happened for me with two RCP applications, the com.example.mail application used in the p2 documentation and my own, also relatively simple application.  This is keeping me from using it in my real application, which is not simple.

This is a significant problem for anyone that wants to enable an existing RCP application for p2.

I can also successfully implement dropins (something I need) as well as the p2 updates, but I lose the splash screen in the process.  Losing the splash screen seems to be related to whatever happens with "Generate metadata repository" and not with adding dropins support, however.

There are no error indications.  The splash just does not appear.

In both cases p2 was enabled by making the .product be based on features and including the org.eclipse.equinox.p2.user.ui feature in feature.xml as is done in several tutorials on the web.  p2 is, in fact, enabled, and works, but there is no longer any splash screen.

Without making any other changes, you can make the splash screen appear again by unchecking "Generate metadata repository" in the dialog you get from "Use the Eclipse product export wizard".  But then the p2 update mechanism does not work, saying it isn't configured correctly.

This happens only on the exported product.  When using "Launch an Eclipse application" in the workspace the splash screen appears.  Of course, the p2 update mechanism does not work from the workspace, but this is known.

So far I have not found any way to get both p2 and a splash screen.

Reproducible: Always

Steps to Reproduce:
1. Enable the com.example.mail example for p2.
2. Deploy from the .product Overview tab with "Generate metadata repository" checked.
3. Note there is no splash screen.
4. Deploy with it unchecked (and no other changes).
5. Note the splash screen is there.
Comment 1 Andrew Niefer CLA 2010-05-07 13:17:29 EDT
This is working fine for me in 3.6 head.  Make sure the product file lists a plugin containing the splash.bmp on the splash tab.

In the exported application does the config.ini have osgi.splashPath?
Comment 2 Kenneth Evans, Jr. CLA 2010-05-07 13:52:24 EDT
It uses  "Generate a default config.ini".  The plug-in with splash.bmp is there.  The fact that I get a splash screen with "Generate metadata repository" unchecked indicates it is set up OK in both these regards.

Thanks,

-Ken
Comment 3 Kenneth Evans, Jr. CLA 2010-05-13 10:58:27 EDT
I apologize for not actually checking config.ini.  The answer is that the "osgi.splashPath=" line is _not_ there.  If I add it manually, then the splash screen appears.  Thus, the problem is that the logic that does "Generate a default config.ini" is wrong when using p2.

This gives me workaround at least.  Thanks.
Comment 4 Kenneth Evans, Jr. CLA 2010-05-13 11:53:14 EDT
>> This gives me workaround at least.

I thought I could specify a config.ini file in the Configuration tab of the .product editor by using "Use an existing config.ini file".  I used the one that it generated automatically before with the additional line for the "osgi.splashPath=".  However, it doesn't use mine and generates a new one without the "osgi.splashPath=" line (hence no splash screen).

I don't understand what is happening.  There are no error messages that I can see. Perhaps this is another error in the config file logic?
Comment 5 Kenneth Evans, Jr. CLA 2010-05-17 13:47:01 EDT
I verified this problem is still happening with 3.6.0 M7.
Comment 6 Andrew Niefer CLA 2010-05-17 13:56:53 EDT
Ken, can you attach your example project that does this so I can try exporting it.
Comment 7 Kenneth Evans, Jr. CLA 2010-05-17 16:26:54 EDT
Andrew,

Thanks for looking at it.  I will attach a ZIP with two projects that are based on com.example.mail with as few changes as possible from the wizard.

When deploying:

1. With "Generate a meta repository" unchecked, there is a splash screen and config.ini has osgi.splashPath in it.

2. With it checked there is no splash and osgi.splashPath does not appear.

3. Using the generated config.ini from 1. and setting the Configure tab to use it, there is still no splash screen or osgi.splashPath.  (This is the current state of the project).

I get the same results with another, slightly more complicated project of my own.

-Ken
Comment 8 Kenneth Evans, Jr. CLA 2010-05-17 16:27:46 EDT
Created attachment 168820 [details]
ZIP file with two com.example.mail attachments.
Comment 9 Andrew Niefer CLA 2010-05-18 14:54:29 EDT
The .product file does not specify the bundle which contains the splash bitmap.
See the splash tab of the product editor.  If you specify the splash plugin there things work fine.

It turns out that when not doing a p2 install, pde.build will look for a "branding" plugin for the product if the splash plugin is not specified.  
The branding plugin is the product id with the last segment removed (org.example.mail.product -> org.example.mail).  

PDE/Build will also check for fragments of the plugin and add them to the splashPath as well.

In the case of a p2 install, the publisher is responsible for generating the osgi.splashPath metadata.  The publisher will need to be updated to do this extra work.

The publisher does not have access to the osgi state that pde/build uses in this case, and will need to do this work by running queries on the available repos.  This seems like a bit too much in RC2 given that there is a simple workaround of just specifying the splash bundle in the .product file.  We can look in 3.6.1

Regarding the config.ini, the attached mail.product file is not using it.  If I edit the .product file to use the config.ini, then the export product will show the splash screen, but quickly exit with an error since when a config.ini is specified, export no longer generates the default config settings and the prodvided config.ini does not give any start levels.
Comment 10 Kenneth Evans, Jr. CLA 2010-05-18 16:22:14 EDT
Andrew,

>> If you specify the splash plugin there things work fine.

Thanks for the workaround.  As much time as I've spent on this, I should have run across that myself and tried it.  In my defense, in years of writing plug-ins I have never had to do that.  That at least solves my immediate problem.  And it works in 3.5.1 also.  Seems like it should be fixed eventually, though, as you mentioned.

>> Regarding the config.ini, the attached mail.product file is not using it.

Sorry about that.  I had done both ways many times.  Apparently what was in the ZIP was without using the config.ini (which is in the project).  Before the change above, it did not give an error to use it, but also did not _use_ it, instead generating an automatic one.  This seems like a problem in itself.

It is nice that you understand why there is _now_ an error message.  From the error message that results, I would have a hard time figuring that out:

!ENTRY org.eclipse.osgi 4 0 2010-05-18 14:47:17.255
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

The config.ini in error that it says to look at seems to be the same as the one generated when not using the default config.ini _and_ not checking "Generate metadata repository" (and _not specifying the splash plug-in).  The config.ini in the project is one of these.  I am confused.

Are these the results you get when using the config.ini in the project I sent (under these various conditions, use/not use, specify/not specify, check/not check)?

Thanks for your help.

-Ken
Comment 11 Andrew Niefer CLA 2010-05-19 16:40:27 EDT
(In reply to comment #10)
> java.lang.IllegalStateException: Unable to acquire application service. Ensure
> that the org.eclipse.core.runtime bundle is resolved and started (see
> config.ini).

> The config.ini in error that it says to look at seems to be the same as the one
> generated when not using the default config.ini _and_ not checking "Generate
> metadata repository" (and _not specifying the splash plug-in).  The config.ini
> in the project is one of these.  I am confused.
> 
> Are these the results you get when using the config.ini in the project I sent
> (under these various conditions, use/not use, specify/not specify, check/not
> check)?
> 


Yes, these are the same results.  The problem is that we are missing start level information.  The config.ini generated as a default uses the simpleconfigurator, and as such does not specify the start levels for any other bundles, that information is in the bundles.info file:

osgi.bundles=org.eclipse.equinox.simpleconfigurator@1:start
org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info

You can add "org.eclipse.equinox.simpleconfigurator/bundles.info" to your project so that it can be found relative to the config.ini file.  However, I found bug 313625, you will need to specify the location of the config.ini file as an absolute path in the .product file.

I also found  Bug 313627
Comment 12 Kenneth Evans, Jr. CLA 2010-05-20 11:06:51 EDT
Andrew,

In another simple example with the same problem I specify the start levels in the .product configuration.  (I don't think I should have to do this, but I do. See #312806 ;-).  It is only needed to implement dropins.  This example has the same problem with the splash and the non-default config.ini as the com.mail.example I sent.  Thus, I don't think it is related to start levels.  The default config.ini for the other example only has:

osgi.bundles.defaultStartLevel=4

as does this one.

There seem (to me) to be problems with generating a non-default config.ini with p2.  You are in a better position to understand that issue than I.  I have little experience in doing that as it is hardly ever necessary (which is good ;-).  The one time I did do it, the config.ini became not working over time owing to changes in the platform and was a nuisance to manage.  It was only done, as in this case, as a workaround for another problem that was eventually fixed.

In any event, specifying the splash plug-in in the .product Splash tab, solves my problem and I don't need the non-default config.ini.  You can decide if the non-default config.ini issues are a problem.  (And thanks for the tip ;-)

In regard to specifying the splash plug-in, it seems to me that the p2 deployment could just assume the splash screen is in the defining plug-in for the .product rather than use the mechanism with the publisher you mentioned.  I would assume that is what is done without p2, since I have never specified the splash plug-in.  If you don't want a splash screen, you can use -nosplash, so this assumption doesn't cause problems and replicates past behavior.

From my perspective (which is from pretty far away ;-) it seems like the p2 team and the PDE team need to interact some more.  I could be wrong and don't mean to be critical.  It will all work sometime.

Thanks for your help,

-Ken
Comment 13 Andrew Niefer CLA 2011-10-20 14:43:59 EDT
Moving to inbox
Comment 14 Eclipse Genie CLA 2019-10-18 12:04:49 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.
Comment 15 Kenneth Evans CLA 2019-10-18 13:07:35 EDT
From my point of view as the originator of the issue it can be closed.  It is so old that I have no memory of the details of the issue.  I probably solved the problem for myself by using the workaround.