Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 306623 - Application.e4xmi should be default for "applicationXMI"
Summary: Application.e4xmi should be default for "applicationXMI"
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows NT
: P3 normal with 2 votes (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-21 02:23 EDT by Lars Vogel CLA
Modified: 2012-07-17 13:23 EDT (History)
6 users (show)

See Also:


Attachments
Patch proposal (1.63 KB, patch)
2012-04-23 19:22 EDT, Nobody - feel free to take it CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-03-21 02:23:37 EDT
Currently if I do not provide a value in my product configuration for "applicationXMI" I receive:

org.eclipse.core.runtime.AssertionFailedException: null argument:applicationXMI argument missing

I suggest to add the default that if no parameter "applicationXMI" is specified that the application tries to use "Application.e4xmi".
Comment 1 Lars Vogel CLA 2010-06-09 15:30:33 EDT
For my reference: Parameter "applicationXMI" is loaded in method loadApplicationModel in class E4Application via the statement

String appModelPath = getArgValue(E4Workbench.XMI_URI_ARG, appContext);
Comment 2 Nobody - feel free to take it CLA 2012-04-23 19:22:18 EDT
Created attachment 214426 [details]
Patch proposal

If the initial search is null (applicationXMI property empty) it defaults to bundlename/Application.e4xmi
Comment 3 Paul Webster CLA 2012-04-24 08:34:47 EDT
(In reply to comment #2)
> Created attachment 214426 [details]
> Patch proposal
> 
> If the initial search is null (applicationXMI property empty) it defaults to
> bundlename/Application.e4xmi

You probably have to be prepared for no branding bundle.  The SDK always has them, what happens if you don't define any branding for a simple RPC app (no product, only an application)?

PW
Comment 4 Lars Vogel CLA 2012-04-24 11:09:52 EDT
@Paul: AFAIK Eclipse 4 application require a product to run. Isn't that the case?
Comment 5 Lars Vogel CLA 2012-04-24 11:10:20 EDT
Except in the compatibility mode but I don't think that this patch is relevant for this case.
Comment 6 Brian de Alwis CLA 2012-04-24 16:04:33 EDT
I think it's better to throw a descriptive error message (e.g., "missing applicationXMI parameter") rather than hard-coding an expectation on a particular file name.
Comment 7 Lars Vogel CLA 2012-04-24 16:09:38 EDT
@Brian: The idea of this bug report was that the setup of Eclipse 4 uses more defaults, e.g. that less configuration is necessary to get started.

If the default file is not present, then the descriptive error message should be shown. I don't think we are loosing anything with the default.
Comment 8 Nobody - feel free to take it CLA 2012-04-24 17:45:05 EDT
(In reply to comment #5)
> Except in the compatibility mode but I don't think that this patch is relevant
> for this case.

Am I wrong in assuming that when using the compatibility layer I would get org.eclipse.ui.workbench/LegacyIDE.e4xmi
as the applicationXMI?
Comment 9 Lars Vogel CLA 2012-04-24 17:57:10 EDT
@Sopot: Correct AFAIK and this would be done in a different class, not the E4Application.
Comment 10 Oleg Besedin CLA 2012-04-27 13:41:53 EDT
(In reply to comment #2)
> Created attachment 214426 [details]
> Patch proposal

Thank you! I released the patch with couple little changes to make it safer.

Git reference:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ea915553b25737026c6a2c9a4a7b4c6243ed2469
Comment 11 Lars Vogel CLA 2012-04-27 14:45:43 EDT
Thanks Oleg and Sopot. That is really helpful for new users.
Comment 12 Oleg Besedin CLA 2012-05-01 11:35:23 EDT
Verified using I20120430-1800.
Comment 13 Shumy Mising name CLA 2012-07-17 05:19:02 EDT
I have a report log with "org.eclipse.core.runtime.AssertionFailedException: null argument:applicationXMI argument missing".

I was completing the tutorial from step 8 in (manual product configuration) http://www.vogella.com/articles/EclipseRCP/article.html

When I run from eclipse, it's all OK, but when I export and try to run the product  , the exception is throw.

Using: 
"Version: Juno Release
Build id: 20120614-1722"
Comment 14 Nobody - feel free to take it CLA 2012-07-17 05:23:59 EDT
What if you provide the applicationXMI parameter pointing to the e4xmi? Does it happen when you export it?
Comment 15 Shumy Mising name CLA 2012-07-17 05:38:50 EDT
That is a good question. I was looking for that. 
Where do I put the parameter?
Comment 16 Nobody - feel free to take it CLA 2012-07-17 05:49:37 EDT
Add it as a product property in the core.runtime.products extension point of the plugin.xml. Right beside appName or applicationCSS.
Comment 17 Shumy Mising name CLA 2012-07-17 06:11:18 EDT
Same problem, more detail:

!ENTRY org.eclipse.equinox.app 0 0 2012-07-17 11:02:39.850
!MESSAGE Product com.example.e4.rcp.todo.product could not be found.

!ENTRY org.eclipse.osgi 4 0 2012-07-17 11:02:40.920
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.AssertionFailedException: null argument:applicationXMI argument missing
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:320)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:220)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:132)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	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:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


My plugin.xml content:
<?xml version="1.0" encoding="UTF-8"?>
<plugin>

   <extension
         id="product"
         point="org.eclipse.core.runtime.products">
      <product
            application="org.eclipse.e4.ui.workbench.swt.E4Application"
            name="com.example.e4.rcp.todo">
         <property
               name="appName"
               value="com.example.e4.rcp.todo">
         </property>
         <property
               name="applicationXMI"
               value="com.example.e4.rcp.todo/Application.e4xmi">
         </property>
      </product>
   </extension>

</plugin>
Comment 18 Nobody - feel free to take it CLA 2012-07-17 06:13:35 EDT
I doubt this has to be tracked in this bug then as it is not because of the default value supplied.

Please file a fresh bug on platform ui.
Thanks.
Comment 19 Shumy Mising name CLA 2012-07-17 06:55:40 EDT
Bug 385285 - And found the problem.
Comment 20 Lars Vogel CLA 2012-07-17 13:23:27 EDT
Still closed.