Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 240084 - Exporting an RCP product causes the built application not to start because of corrupt config.ini file
Summary: Exporting an RCP product causes the built application not to start because of...
Status: RESOLVED DUPLICATE of bug 240053
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-08 17:33 EDT by Mircea Luchian CLA
Modified: 2008-09-05 11:12 EDT (History)
5 users (show)

See Also:


Attachments
original post (13.47 KB, application/octet-stream)
2008-07-08 17:33 EDT, Mircea Luchian CLA
no flags Details
.product file (9.54 KB, application/xml)
2008-07-09 11:49 EDT, Mircea Luchian CLA
no flags Details
plug in list (104.67 KB, text/plain)
2008-07-09 11:59 EDT, Mircea Luchian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Luchian CLA 2008-07-08 17:33:29 EDT
Created attachment 106885 [details]
original post

Build ID: I20080617-2000

Steps To Reproduce:
- In Eclipse 3.4, import projects that make your RCP application. In my case, I have an RCP based IDE greated in Eclipse 3.3.2.
- Some compilations errors may exist while migrating the projects from 3.3.2 to 3.4. Fix them.
- Open the product configuration file (.product). 
- Make sure in the Configuration tab ad the bottom of the editor has the "Generate a default config.ini file" radio button selected.
- Right click on the .product file in your Eclipse 3.4 IDE and select export -> Plugin Development -> Eclipse Product.
- In the wizard, select a directory to export the RCP app. 
- Click finish. The application will be built.
- Go to the directory and execute the your custom application.




More information:
- A pop up appears saying "An error has occured: See the log file ... "
- Log file contents are: 
!ENTRY org.eclipse.osgi 4 0 2008-07-08 12:50:12.941
!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:382)
    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:549)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

The config.ini file generated by Eclipse 3.4 is:
#Product Runtime Configuration File
osgi.splashPath=platform:/base/plugins/com.matrox.fdk.core
eclipse.product=com.matrox.fdk.core.product
osgi.bundles.defaultStartLevel=4
osgi.bundles=org.eclipse.equinox.transforms.hook@4

As a comparison, the config.ini file generated by Eclipse 3.3.2 is: 
#Product Runtime Configuration File
osgi.splashPath=platform:/base/plugins/com.matrox.fdk.core
eclipse.product=com.matrox.fdk.core.product
osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start
osgi.bundles.defaultStartLevel=4

The parameters org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start  are missing from the config.ini file generated by 3.4. It causes the application not to start with the above exception. 
Therefore the product export wizard fails to add the necessary startup parameters needed to start an RCP application from an EXE. 

I manually changed the config.ini file to: 
#Product Runtime Configuration File
osgi.splashPath=platform:/base/plugins/com.matrox.fdk.core
eclipse.product=com.matrox.fdk.core.product
osgi.bundles.defaultStartLevel=4
osgi.bundles=org.eclipse.equinox.transforms.hook@4,org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start

and the problem went away.
Comment 1 Paul Allen CLA 2008-07-08 18:52:22 EDT
I an confirm that this problem exists in the Ganymede flavor of 3.4 on Linux, and that Mircea's proposed fix works.
Comment 2 Andrew Niefer CLA 2008-07-09 10:54:07 EDT
On export, config.ini is currently generated in ProductExportOperation
Comment 3 Chris Aniszczyk CLA 2008-07-09 10:58:13 EDT
I'm not convinced the default config.ini generated by Eclipse is going to be:

The config.ini file generated by Eclipse 3.4 is:
...
osgi.bundles=org.eclipse.equinox.transforms.hook@4
...

PDE wouldn't just insert equinox.transforms.hook in there. There has to be some other config.ini lying around that maybe you're using as a template?
Comment 4 Mircea Luchian CLA 2008-07-09 11:35:41 EDT
When I build my application in Win 32, the "Generate a default config.ini file" radio button is selected, so I use the default config.ini made by Eclipse 3.4. I do not use the "existing config.ini file" option. 

The file generate by default contains
...
osgi.bundles=org.eclipse.equinox.transforms.hook@4
...
Comment 5 Chris Aniszczyk CLA 2008-07-09 11:38:32 EDT
can you post your  .product file here?
Comment 6 Mircea Luchian CLA 2008-07-09 11:49:00 EDT
Created attachment 106962 [details]
.product file

Here it is
Comment 7 Chris Aniszczyk CLA 2008-07-09 11:50:52 EDT
do you happen to have code from the Equinox Incubator installed... it's called "Product Customization"... it uses the Equinox Transforms code so I'm wondering if it's messing with your config.ini generation somehow
Comment 8 Mircea Luchian CLA 2008-07-09 11:59:15 EDT
Created attachment 106966 [details]
plug in list

Do you refer to the plug in list? I haven't found a plug in called "Product Configuration". 
Here is the plug in list I have:
Comment 9 Mircea Luchian CLA 2008-07-09 12:01:15 EDT
I meant "Product Customization"

(In reply to comment #8)
> Created an attachment (id=106966) [details]
> plug in list
> 
> Do you refer to the plug in list? I haven't found a plug in called "Product
> Configuration". 
> Here is the plug in list I have:
> 

Comment 10 Stephan Arenswald CLA 2008-09-05 04:10:26 EDT
The problem does not appear each time an eclipse rcp application is exported. I created an RCP App using Eclipse 3.4 from start. I had no problems until this week. After several hours (meanwhile I found this bug report) I figured out that it depends on the plugins that are used by the RCP. This week I set org.eclipse.hyades.logging.core as dependency and the error occurred. I'm not sure why org.eclipse.update.configurator is suddenly needed. I now have the following plug-ins in my product configuration with which the export works fine.
Even if I press "Add Required Plug-ins" in the product configuration, org.eclipse.update.configurator doesn't show up.

<plugin id="org.apache.derby"/>
<plugin id="org.apache.derby.core"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.databinding"/>
<plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filebuffers"/>
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.resources.compatibility" fragment="true"/>
<plugin id="org.eclipse.core.resources.win32.x86" fragment="true"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
<plugin id="org.eclipse.core.variables"/>
<plugin id="org.eclipse.debug.core"/>
<plugin id="org.eclipse.debug.ui"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.equinox.transforms.hook" fragment="true"/>
<plugin id="org.eclipse.help"/>
<plugin id="org.eclipse.jface"/>
<plugin id="org.eclipse.jface.databinding"/>
<plugin id="org.eclipse.jface.text"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.pde.runtime"/>
<plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
<plugin id="org.eclipse.text"/>
<plugin id="org.eclipse.ui"/>
<plugin id="org.eclipse.ui.console"/>
<plugin id="org.eclipse.ui.editors"/>
<plugin id="org.eclipse.ui.forms"/>
<plugin id="org.eclipse.ui.ide"/>
<plugin id="org.eclipse.ui.navigator"/>
<plugin id="org.eclipse.ui.navigator.resources"/>
<plugin id="org.eclipse.ui.views"/>
<plugin id="org.eclipse.ui.views.properties.tabbed"/>
<plugin id="org.eclipse.ui.win32" fragment="true"/>
<plugin id="org.eclipse.ui.workbench"/>
<plugin id="org.eclipse.ui.workbench.texteditor"/>
Comment 11 Chris Aniszczyk CLA 2008-09-05 11:02:08 EDT
I'm just about 100% sure this will be fixed with this bug:

240053: product export from the ui does not generate bundles.info
https://bugs.eclipse.org/bugs/show_bug.cgi?id=240053

It will be out in 3.4.2 and 3.5M2.

There was an issue for ages in PDE where UI and Build have separately done product exports. With the above bug closed, PDE UI will now delegate to Build to do the proper thing.

Sorry for the trouble.
Comment 12 Chris Aniszczyk CLA 2008-09-05 11:12:05 EDT
Going to mark this as a dupe.

This problem is fixed by bug 240053 when it will be committed.


*** This bug has been marked as a duplicate of bug 240053 ***