0

I created a sample e4 Project containing a single plugin consisting of a plugin.xml file, fragment.e4xmi file, .product file & a single .Java Handler class which will be responsible to display a Message Dialog as soon as my custom menu is clicked.

With having this setup I am able to launch the product in debug mode (and I'm able to see my customized menu), whereas I couldn't able to launch the exported product. I'm getting the following error when I try to do so :

java.lang.RuntimeException: Application "org.eclipse.e4.ui.workbench.swt.E4Application" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.equinox.app.error.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

Any ways to resolve these ???

Ragu
  • 187
  • 1
  • 11

1 Answers1

0

If you are using a plug-ins based build the Dependencies page of your .product file must list every plugin that is required. The 'Add Required' button on that page may help.

For a feature based build the Dependencies page must list features which include all the required plugins.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • I tried including all the required plugins with help of "Add Required Plugins" button. All exceptions were cleared except for the following one : java.lang.RuntimeException: Application "org.eclipse.e4.ui.workbench.swt.E4Application" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.equinox.app.error. at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248) at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29) – Ragu Sep 09 '15 at 14:05
  • I've edited my question to reflect the exceptions which I got finally ( i.e.., after doing 'Add Required Plugins' to the .product file ) – Ragu Sep 09 '15 at 14:12
  • E4Application is in `org.eclipse.e4.ui.workbench.swt` add this to the dependencies (and do Add Required again afterwards). – greg-449 Sep 09 '15 at 14:17
  • greg-449 : I added the plugin 'org.eclipse.e4.ui.workbench.swt' as dependency to the .product file, After adding this plugin as a dependency followed by the 'Add Required Plugins'. I'm still able to see the error, Now my exceptions count have been increased :) Previously it was just one, but after doing this reverts my question to the previous state :) ( i.e.., The exception stack trace now becomes similar to the one before my EDIT ) – Ragu Sep 09 '15 at 14:33
  • This [link](http://stackoverflow.com/questions/18571901/application-org-eclipse-e4-ui-workbench-swt-e4application-could-not-be-found-i) describes a similar problem. But already my product file contains these.. – Ragu Sep 09 '15 at 14:38
  • Look at the 'Run > Run Configuration' that you used to test the application. Include everything from that in the product dependencies. – greg-449 Sep 09 '15 at 14:53
  • Hi Greg, I don't see any plugins listed in the 'Run -> Run Configuration' Dialog. In Plug-ins Tab of 'Run Configurations' Dialog, I noticed the following fields : 'Launch With', 'Default Start level' & 'Default Auto-Start' and these were assigned values of 'all workspace and enabled target plug-ins', '4' & 'False' respectively. Can you please elaborate on what you mean by "Include everything from that in the product dependencies" ?? – Ragu Sep 10 '15 at 05:49
  • Greg : One more question I have with regards to e4 XMI file. The question is, If we have few customized menus in the XMI file. Whether during product launch (in release mode as eclipse product) it will contain only these new menus only ? Or it will also contain the eclipse menus also ? - just curious to know. – Ragu Sep 10 '15 at 06:02
  • If you build a product you get a complete product with all menus. If you are trying to build add-on plugins for Eclipse you should be using 'Export > Deployable plug-ins and Fragments' – greg-449 Sep 10 '15 at 06:52
  • Thanks Greg, anyways to fix this product launch error ? Can you please elaborate on what you mean by "Include everything from that in the product dependencies" ?? I don't see any plugins listed in the 'Run -> Run Configuration' Dialog. In Plug-ins Tab of 'Run Configurations' Dialog, I noticed the following fields : 'Launch With', 'Default Start level' & 'Default Auto-Start' and these were assigned values of 'all workspace and enabled target plug-ins', '4' & 'False' respectively. – Ragu Sep 10 '15 at 09:13
  • Change 'all workspace and enabled target plugins' to 'plugins selected below' to see the plugins being used. You just have to work through adding every required plugin to the .product file, this can be hard work. Using a 'feature' build is easier. – greg-449 Sep 10 '15 at 09:21
  • Hi Greg, one last question, I am not trying to build add-on plugins for Eclipse. My aim is to disable (or completely remove) all the default eclipse menus (viz.., "File", "Edit", "Source", etcc..,) and I require only the menus that I have in the "fragment.e4xmi" file to be visible ( or should gain full attention and should probably override the eclipse default menus). – Ragu Sep 10 '15 at 13:41
  • Then you should not be using a fragment, you should be building a RCP using a Application.e4xmi or a 3.x RCP. – greg-449 Sep 10 '15 at 13:43
  • Ohh.. So If I use an Application.e4xmi, then it will automatically override the eclipse default menus and displays only the custom menus which I have in the Application.e4xmi file ? – Ragu Sep 10 '15 at 13:47
  • No, there are no 'defaults', the Application.e4xmi is what determines what UI objects exists - menus, views, everything. If you do this you have to design the entire look of the RCP. Read something like http://www.vogella.com/tutorials/EclipseRCP/article.html – greg-449 Sep 10 '15 at 13:53
  • Hi Greg, I'm now using the 'Application.e4xmi' file instead of the fragment.xmi file as suggested by you. I've created my own menus in this file and how to associate this file into the product ? Previously when I use the fragment.xmi file I use to associate it to the plugin.xml file usign the extension point "org.eclipse.e4.workbench.model". – Ragu Sep 11 '15 at 11:25
  • I observed that it is specified in build.properties file – Ragu Sep 11 '15 at 11:27
  • Comments are not intended for an endless stream of questions. How you use the Application.e4xmi is covered in the tutorial I referenced. – greg-449 Sep 11 '15 at 12:02