0

I am new to RCP development and I've problem with creating product configuration. IDE: Eclipse Mars 4.5.1

I created an Eclipse plug-in project named "com.ex.mail" using predefined template "RCP 3.x Mail Template". This plug-in work (Launching a separete Eclipse application)!

After that, I created a new product configuration ("mail.product") in the same plugin project.

This is mail.product:

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="todo" id="com.ex.mail.product1" application="com.ex.mail.application" useFeatures="false" includeLaunchers="true">
   <configIni use="default">
   </configIni>
   <launcherArgs>
      <programArgs>-clean -clearPersistedState
      </programArgs>
      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
      </vmArgsMac>
   </launcherArgs>
   <launcher>
      <solaris/>
      <win useIco="false">
         <bmp/>
      </win>
   </launcher>
   <vm>
   </vm>
   <plugins>
      <plugin id="com.ex.mail"/>
      <plugin id="com.ibm.icu"/>
      <plugin id="javax.annotation"/>
      <plugin id="javax.inject"/>
      <plugin id="javax.xml"/>
      <plugin id="org.apache.batik.css"/>
      <plugin id="org.apache.batik.util"/>
      <plugin id="org.apache.batik.util.gui"/>
      <plugin id="org.apache.commons.jxpath"/>
      <plugin id="org.eclipse.core.commands"/>
      <plugin id="org.eclipse.core.contenttype"/>
      <plugin id="org.eclipse.core.databinding"/>
      <plugin id="org.eclipse.core.databinding.observable"/>
      <plugin id="org.eclipse.core.databinding.property"/>
      <plugin id="org.eclipse.core.expressions"/>
      <plugin id="org.eclipse.core.jobs"/>
      <plugin id="org.eclipse.core.runtime"/>
      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
      <plugin id="org.eclipse.e4.core.commands"/>
      <plugin id="org.eclipse.e4.core.contexts"/>
      <plugin id="org.eclipse.e4.core.di"/>
      <plugin id="org.eclipse.e4.core.di.annotations"/>
      <plugin id="org.eclipse.e4.core.di.extensions"/>
      <plugin id="org.eclipse.e4.core.services"/>
      <plugin id="org.eclipse.e4.emf.xpath"/>
      <plugin id="org.eclipse.e4.ui.bindings"/>
      <plugin id="org.eclipse.e4.ui.css.core"/>
      <plugin id="org.eclipse.e4.ui.css.swt"/>
      <plugin id="org.eclipse.e4.ui.css.swt.theme"/>
      <plugin id="org.eclipse.e4.ui.di"/>
      <plugin id="org.eclipse.e4.ui.model.workbench"/>
      <plugin id="org.eclipse.e4.ui.services"/>
      <plugin id="org.eclipse.e4.ui.widgets"/>
      <plugin id="org.eclipse.e4.ui.workbench"/>
      <plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench3"/>
      <plugin id="org.eclipse.emf.common"/>
      <plugin id="org.eclipse.emf.ecore"/>
      <plugin id="org.eclipse.emf.ecore.change"/>
      <plugin id="org.eclipse.emf.ecore.xmi"/>
      <plugin id="org.eclipse.equinox.app"/>
      <plugin id="org.eclipse.equinox.common"/>
      <plugin id="org.eclipse.equinox.ds"/>
      <plugin id="org.eclipse.equinox.preferences"/>
      <plugin id="org.eclipse.equinox.registry"/>
      <plugin id="org.eclipse.equinox.util"/>
      <plugin id="org.eclipse.help"/>
      <plugin id="org.eclipse.jface"/>
      <plugin id="org.eclipse.jface.databinding"/>
      <plugin id="org.eclipse.osgi"/>
      <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
      <plugin id="org.eclipse.osgi.services"/>
      <plugin id="org.eclipse.swt"/>
      <plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
      <plugin id="org.eclipse.ui"/>
      <plugin id="org.eclipse.ui.workbench"/>
      <plugin id="org.w3c.css.sac"/>
      <plugin id="org.w3c.dom.events"/>
      <plugin id="org.w3c.dom.smil"/>
      <plugin id="org.w3c.dom.svg"/>
   </plugins>
   <configurations>
      <plugin id="com.ex.mail" autoStart="false" startLevel="5" />
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.equinox.p2.reconciler.dropins" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
   </configurations>
</product>

When I launch RCP application using link in tab "Overview" of mail.product I've this error:

!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2016-01-11 12:19:58.277
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:898)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:121)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:86)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:73)
    at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1486)
    at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1460)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActiveShell(WorkbenchSourceProvider.java:944)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider.getCurrentState(WorkbenchSourceProvider.java:138)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:704)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1266)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1112)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1673)
    at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2193)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4673)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1633)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2117)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
    at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method)
    at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:230)
    at org.eclipse.swt.widgets.Shell.open(Shell.java:1244)
    at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:694)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:746)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:717)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:711)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:695)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1057)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at com.ex.mail.Application.start(Application.java:20)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    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:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Caused by: java.lang.NullPointerException
    at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:4057)
    at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:737)
    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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    ... 53 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2016-01-11 12:19:58.280
!MESSAGE Exception occurred while rendering: org.eclipse.e4.ui.model.application.ui.basic.impl.TrimmedWindowImpl@67545b57 (elementId: IDEWindow, tags: [topLevel], contributorURI: platform:/plugin/org.eclipse.ui.workbench) (widget: Shell {todo}, renderer: org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer@32f61a31, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (label: null, iconURI: null, tooltip: null, context: TrimmedWindowImpl (IDEWindow) Context, variables: [], x: 125, y: 125, width: 600, height: 400)
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:898)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:121)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:86)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:73)
    at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1486)
    at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1460)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActiveShell(WorkbenchSourceProvider.java:944)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider.getCurrentState(WorkbenchSourceProvider.java:138)
    at org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:704)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1266)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1112)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1673)
    at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2193)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4673)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1633)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2117)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
    at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method)
    at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:230)
    at org.eclipse.swt.widgets.Shell.open(Shell.java:1244)
    at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:694)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:746)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:717)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:711)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:695)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1057)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at com.ex.mail.Application.start(Application.java:20)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    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:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Caused by: java.lang.NullPointerException
    at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:4057)
    at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:737)
    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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    ... 53 more

Suggest? Thanks

CarlosD
  • 1
  • 3
  • Possibly some plugins missing. In the .product editor switch to the 'Contents' tab and click the 'Add Required' button. – greg-449 Jan 11 '16 at 12:19
  • I added all plugin in this way.Also, in 'Configuration' tab, in box "Start levels" I added other plugin by clicking the button 'Add racommended...'. I still have the error! – CarlosD Jan 11 '16 at 13:17

2 Answers2

0

Did you synchronized the product ? Is the product pointing to an instantiated "org.eclipse.runtime.products" extension point ? Is the application pointing to an instantiated org.eclipse.core.runtime.applications ?

As the stack trace shows a problem related to a perspective, I suggest there is no instantiated Application, whose attribute WorkbenchAdvisor provides the initial windows perspective.

alt3
  • 21
  • 5
  • It works out from the environment Eclipse after I exported the product with "Eclipse Product export wizard". The problem is when I run the product in the IDE eclipse – CarlosD Jan 12 '16 at 11:32
  • Did you synchronize the configuration ? – alt3 Jan 12 '16 at 12:37
  • Yes! Now the application starts without menus and windows. In console has disappeared the previous error but I always following messages: !ENTRY org.eclipse.e4.ui.workbench 4 0 2016-01-12 14:29:17.820 !MESSAGE Event Admin service is not available, unable to publish event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/renderer/requestEnablementUpdate] {org.eclipse.e4.data=ALL}. – CarlosD Jan 12 '16 at 13:30
  • Why, despite being a 3.x application, when include plugin with "Add Required Plugin..." it includes plugins refer to the technology 4e (org.eclipse.e4.ui.workbench, org.eclipse.e4.ui.workbench.addons.swt....)? – CarlosD Jan 12 '16 at 13:38
  • Did you follow reference tutorial such as http://www.vogella.com/tutorials/EclipseProductDeployment/article.html? – alt3 Jan 13 '16 at 12:56
0

With eclipse mars, the wizard can actually create a base rich client application for you which includes a product configuration file, an application model file and the required plug-ins added. You don't have to create and configure the product configuration yourself.

Check out this simple tutorial on how to get started.