Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Unhandled event loop exception,Reason:,java.lang.NullPointerException
Unhandled event loop exception,Reason:,java.lang.NullPointerException [message #153922] Wed, 13 October 2004 19:06 Go to next message
Eclipse UserFriend
Originally posted by: boby.vt.edu

Hi
i am trying to build a multipage editor (with one page showing the
graphical viewer and the other a XML based text editor). I have looked
at the Networkeditor and flowlogic example. The problem is that when i
try to add a component (equivalent of activity in the flow example) i
get unhandled event loop exception. Basically i click on the component
in the palette and then move mouse into the viewer (The cursor changes
to "stop sign", instead of the "drop sign") and click inside the viewer.
the stack trace of the error and "stack trace" of what i did is attached
below. Any help in solving this problem is much appreciated

thanks

!SESSION Oct 13, 2004 15:03:00.968
---------------------------------------------
eclipse.buildId=unknown
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -application org.eclipse.ui.ide.workbench -pdelaunch

!ENTRY org.eclipse.ui 4 4 Oct 13, 2004 15:03:00.968
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Oct 13, 2004 15:03:00.984
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
at
org.eclipse.gef.tools.CreationTool.handleButtonDown(Creation Tool.java:143)
at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.ja va:977)
at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:201)
at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Pressed(DomainEventDispatcher.java:327)
at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown( LightweightSystem.java:503)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:132)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:96)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
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.core.launcher.Main.basicRun(Main.java:183)
at org.eclipse.core.launcher.Main.run(Main.java:644)
at org.eclipse.core.launcher.Main.main(Main.java:628)

This is more like a stack trace of what i did till now.

1. i created a plugin using the "plugin with multipage editor" template.

2. Then looking at the NetworkEditor example of IBM Red book, in the
main file XCModelEditor (in example equ is networkeditor.java) removed
page 3 and changed page 2 to call the Editor (ModelEditor). The
XCModelEditor was modeled based on networkeditor and i added things like
MultiPageCommandStackListener, delegatingCommandStackListener,
ISelectionListener, getSharedKeyHandler

3. created the modeleditor by looking at networkpage and
AbstractEditorPage. it has EditDomain, createPartControl (using splitter
as in flow example), createGraphicalViewer (sets a new diagram and
addDropTargetListener), createPaletteViewer, getPaletteRoot (which calls
ModelEditorPaletteFactory), init (which has setSite(site) and
setInput(input))

4. then based on flowexample, i created following files
ComponentImages (to hold images),
In dnd package -> ComponentTemplateTransferDropTargetListener,
In figures package (copied from flow example) -> SubgraphFigure,
In model package -> AbstractComponent, Component,
ComponentElementFactory, ModelComponent (equivalent of activitydiagram,
since i got only components, i dont need StructuredActivity,
ParallelActivity), Transition
In model.commands package (all copied from flow example)->
AddAndAssignSourceCommand, ConnectionCreateCommand,
CreateAndAssignSourceCommand, DeleteCommand, ReconnectSourceCommand,
ReconnectTargetCommand
In parts package -> BottomAnchor, TopAnchor, ComponentPart (abstract),
SimpleComponentPart, StructuredComponentPart (abstract),
ModelComponentPart, DummyLayout, GraphAnimation,
GraphicalEditPartsFactory, GraphLayoutManager, TransitionPart
In policies package -> ComponentNodeEditPolicy,
ComponentSourceEditPolicy, TransitionEditPolicy, XCComponentEditPolicy
(equivalent of ActivityEditPolicy)
in ui package -> ModelEditorPaletteFactory.
Re: Unhandled event loop exception,Reason:,java.lang.NullPointerException [message #154180 is a reply to message #153922] Thu, 14 October 2004 20:52 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Set a breakpoint in CreationTool.handleButtonDown and find out what is null.
It seems the TargetEditPart is. In that case, set a breakpoint in
CreationTool.handleMove() and find out why the target is null. The target
should be properly detected and set when updateTargetUnderMouse() is
invoked.

"Boby George" <boby@vt.edu> wrote in message
news:ckju0j$fi7$1@eclipse.org...
> Hi
> i am trying to build a multipage editor (with one page showing the
> graphical viewer and the other a XML based text editor). I have looked
> at the Networkeditor and flowlogic example. The problem is that when i
> try to add a component (equivalent of activity in the flow example) i
> get unhandled event loop exception. Basically i click on the component
> in the palette and then move mouse into the viewer (The cursor changes
> to "stop sign", instead of the "drop sign") and click inside the viewer.
> the stack trace of the error and "stack trace" of what i did is attached
> below. Any help in solving this problem is much appreciated
>
> thanks
>
> !SESSION Oct 13, 2004 15:03:00.968
> ---------------------------------------------
> eclipse.buildId=unknown
> java.version=1.4.2_05
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Command-line arguments: -application
org.eclipse.ui.ide.workbench -pdelaunch
>
> !ENTRY org.eclipse.ui 4 4 Oct 13, 2004 15:03:00.968
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 Oct 13, 2004 15:03:00.984
> !MESSAGE java.lang.NullPointerException
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.gef.tools.CreationTool.handleButtonDown(Creation Tool.java:143)
> at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.ja va:977)
> at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:201)
> at
>
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Pressed(DomainEv
entDispatcher.java:327)
> at
>
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown( LightweightSyste
m.java:503)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:132)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
> at
>
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:96)
> at
>
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:335)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> 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.core.launcher.Main.basicRun(Main.java:183)
> at org.eclipse.core.launcher.Main.run(Main.java:644)
> at org.eclipse.core.launcher.Main.main(Main.java:628)
>
> This is more like a stack trace of what i did till now.
>
> 1. i created a plugin using the "plugin with multipage editor" template.
>
> 2. Then looking at the NetworkEditor example of IBM Red book, in the
> main file XCModelEditor (in example equ is networkeditor.java) removed
> page 3 and changed page 2 to call the Editor (ModelEditor). The
> XCModelEditor was modeled based on networkeditor and i added things like
> MultiPageCommandStackListener, delegatingCommandStackListener,
> ISelectionListener, getSharedKeyHandler
>
> 3. created the modeleditor by looking at networkpage and
> AbstractEditorPage. it has EditDomain, createPartControl (using splitter
> as in flow example), createGraphicalViewer (sets a new diagram and
> addDropTargetListener), createPaletteViewer, getPaletteRoot (which calls
> ModelEditorPaletteFactory), init (which has setSite(site) and
> setInput(input))
>
> 4. then based on flowexample, i created following files
> ComponentImages (to hold images),
> In dnd package -> ComponentTemplateTransferDropTargetListener,
> In figures package (copied from flow example) -> SubgraphFigure,
> In model package -> AbstractComponent, Component,
> ComponentElementFactory, ModelComponent (equivalent of activitydiagram,
> since i got only components, i dont need StructuredActivity,
> ParallelActivity), Transition
> In model.commands package (all copied from flow example)->
> AddAndAssignSourceCommand, ConnectionCreateCommand,
> CreateAndAssignSourceCommand, DeleteCommand, ReconnectSourceCommand,
> ReconnectTargetCommand
> In parts package -> BottomAnchor, TopAnchor, ComponentPart (abstract),
> SimpleComponentPart, StructuredComponentPart (abstract),
> ModelComponentPart, DummyLayout, GraphAnimation,
> GraphicalEditPartsFactory, GraphLayoutManager, TransitionPart
> In policies package -> ComponentNodeEditPolicy,
> ComponentSourceEditPolicy, TransitionEditPolicy, XCComponentEditPolicy
> (equivalent of ActivityEditPolicy)
> in ui package -> ModelEditorPaletteFactory.
Re: Unhandled event loop exception,Reason:,java.lang.NullPointerException [message #157516 is a reply to message #153922] Wed, 10 November 2004 08:51 Go to previous message
Eclipse UserFriend
Originally posted by: notavalidaddress.notavaliddomain.com

Hi,

Did you manage to solve this? I have exactly the same problem!

Thanks.

"Boby George" <boby@vt.edu> wrote in message
news:ckju0j$fi7$1@eclipse.org...
> Hi
> i am trying to build a multipage editor (with one page showing the
> graphical viewer and the other a XML based text editor). I have looked
> at the Networkeditor and flowlogic example. The problem is that when i
> try to add a component (equivalent of activity in the flow example) i
> get unhandled event loop exception. Basically i click on the component
> in the palette and then move mouse into the viewer (The cursor changes
> to "stop sign", instead of the "drop sign") and click inside the viewer.
> the stack trace of the error and "stack trace" of what i did is attached
> below. Any help in solving this problem is much appreciated
>
> thanks
>
> !SESSION Oct 13, 2004 15:03:00.968
> ---------------------------------------------
> eclipse.buildId=unknown
> java.version=1.4.2_05
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Command-line arguments: -application
org.eclipse.ui.ide.workbench -pdelaunch
>
> !ENTRY org.eclipse.ui 4 4 Oct 13, 2004 15:03:00.968
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 Oct 13, 2004 15:03:00.984
> !MESSAGE java.lang.NullPointerException
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.gef.tools.CreationTool.handleButtonDown(Creation Tool.java:143)
> at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.ja va:977)
> at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:201)
> at
>
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Pressed(DomainEv
entDispatcher.java:327)
> at
>
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown( LightweightSyste
m.java:503)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:132)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
> at
>
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:96)
> at
>
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:335)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> 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.core.launcher.Main.basicRun(Main.java:183)
> at org.eclipse.core.launcher.Main.run(Main.java:644)
> at org.eclipse.core.launcher.Main.main(Main.java:628)
>
> This is more like a stack trace of what i did till now.
>
> 1. i created a plugin using the "plugin with multipage editor" template.
>
> 2. Then looking at the NetworkEditor example of IBM Red book, in the
> main file XCModelEditor (in example equ is networkeditor.java) removed
> page 3 and changed page 2 to call the Editor (ModelEditor). The
> XCModelEditor was modeled based on networkeditor and i added things like
> MultiPageCommandStackListener, delegatingCommandStackListener,
> ISelectionListener, getSharedKeyHandler
>
> 3. created the modeleditor by looking at networkpage and
> AbstractEditorPage. it has EditDomain, createPartControl (using splitter
> as in flow example), createGraphicalViewer (sets a new diagram and
> addDropTargetListener), createPaletteViewer, getPaletteRoot (which calls
> ModelEditorPaletteFactory), init (which has setSite(site) and
> setInput(input))
>
> 4. then based on flowexample, i created following files
> ComponentImages (to hold images),
> In dnd package -> ComponentTemplateTransferDropTargetListener,
> In figures package (copied from flow example) -> SubgraphFigure,
> In model package -> AbstractComponent, Component,
> ComponentElementFactory, ModelComponent (equivalent of activitydiagram,
> since i got only components, i dont need StructuredActivity,
> ParallelActivity), Transition
> In model.commands package (all copied from flow example)->
> AddAndAssignSourceCommand, ConnectionCreateCommand,
> CreateAndAssignSourceCommand, DeleteCommand, ReconnectSourceCommand,
> ReconnectTargetCommand
> In parts package -> BottomAnchor, TopAnchor, ComponentPart (abstract),
> SimpleComponentPart, StructuredComponentPart (abstract),
> ModelComponentPart, DummyLayout, GraphAnimation,
> GraphicalEditPartsFactory, GraphLayoutManager, TransitionPart
> In policies package -> ComponentNodeEditPolicy,
> ComponentSourceEditPolicy, TransitionEditPolicy, XCComponentEditPolicy
> (equivalent of ActivityEditPolicy)
> in ui package -> ModelEditorPaletteFactory.
Previous Topic:HTML widget control
Next Topic:Selection Question
Goto Forum:
  


Current Time: Thu Apr 25 18:08:18 GMT 2024

Powered by FUDForum. Page generated in 0.03412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top