cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException in ActivitiDiagramMatchingStrategy

mmaker1234
Champ in-the-making
Champ in-the-making
Hello Activiti developers,

I have Eclipse 4.2 (Juno) SR2 and everything run fine until I installed Activiti Designer 5.12. Then the following problem occurred: while editing Java code (usually but not mandatory in the Java perspective) and select "Open Declaration", "Open Implementation" or "Open Super Implementation" from the mouse context menu (holding the Control key point to a method invocation) the desired action is not executed and the error log demonstrates the following exception:[java]eclipse.buildId=M20130204-1200
java.version=1.6.0_43
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

Error
Tue May 21 13:49:28 EEST 2013


org.eclipse.e4.core.di.InjectionException: org.eclipse.core.commands.ExecutionException: While executing the action, an exception occurred
   at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
   at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:231)
   at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:212)
   at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
   at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:277)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:496)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:547)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:368)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:314)
   at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:83)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
   at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
   at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1823)
   at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4892)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:4560)
   at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:4989)
   at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
   at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
   at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
   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(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   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)
Caused by: org.eclipse.core.commands.ExecutionException: While executing the action, an exception occurred
   at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:124)
   at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
   … 46 more
Caused by: java.lang.NullPointerException
   at org.activiti.designer.eclipse.editor.ActivitiDiagramMatchingStrategy.matches(ActivitiDiagramMatchingStrategy.java:20)
   at org.eclipse.ui.internal.WorkbenchPage.checkEditor(WorkbenchPage.java:2225)
   at org.eclipse.ui.internal.WorkbenchPage.findEditors(WorkbenchPage.java:2194)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2997)
   at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:2969)
   at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2951)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2947)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2911)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2902)
   at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:373)
   at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:179)
   at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
   at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174)
   at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
   at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
   at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
   at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
   … 52 more
[/java]Please advise some solution.
2 REPLIES 2

mmaker1234
Champ in-the-making
Champ in-the-making
The same error displays when you try to open a class through "Open Type" dialog (Ctrl-Shift-T in the Java perspective).

Both problems seems to happen in some strange cases:
  1. The referred class.method() should be in a library;
  2. The source of the class should be in a separate Eclipse project;
  3. It seems the approach to provide the source of the library plays some role:
    • The source was attached before the installation of the Activiti Designer;
    • I tried to remove then attach the library source through Project -> Properties -> Java Build Path. The result was the same error (that is why I reported it);
    • Later I tried to:
      • remove the library source (not the library itself) through Project -> Properties -> Java Build Path;
      • invoke the "Open Declaration" (result was window with decompiled source and button "Attach Source");
      • attach the library source using the "Attach Source" button.
    • Everything went back to fine. I even tried to repeat remove and attach the source via Project -> Properties -> Java Build Path and it worked again.
    (Weird, isn't it?)

    tiesebarrell
    Champ in-the-making
    Champ in-the-making
    I have provided a fix for these NPEs which should be included in the next release of Designer. It occurred in a different case IIRC, but the cause was the same faulty code in the matching strategy.