Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Null Pointer Exception on class diagram opening
Null Pointer Exception on class diagram opening [message #625314] Sun, 22 November 2009 03:07 Go to next message
Kieran Simpson is currently offline Kieran SimpsonFriend
Messages: 10
Registered: November 2009
Junior Member
I created a class diagram with the UML2 Tools CD editor (0.9). I made some ammendments to the model (in the .uml file). Adding comments mainly (I have a bad memory).

When I go to open the CD diagram file (.umlclass), I get the following error.


java.lang.NullPointerException
at org.eclipse.uml2.diagram.clazz.part.UMLDiagramUpdater.getCon tainedTypeModelFacetLinks_TemplateBinding_4016(UMLDiagramUpd ater.java:4361)
at org.eclipse.uml2.diagram.clazz.part.UMLDiagramUpdater.getCla ss_2001ContainedLinks(UMLDiagramUpdater.java:1869)
at org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart.get Class_2001ContainedLinks(Class2EditPart.java:1889)
at org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart.add SemanticListeners(Class2EditPart.java:1856)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.activate(GraphicalEditPart.java:201)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalCon nectionEditPolicy.refreshOnActivate(CanonicalConnectionEditP olicy.java:106)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.activate(CanonicalEditPolicy.java:646)
at org.eclipse.uml2.diagram.clazz.edit.policies.PackageCanonica lEditPolicy.activate(PackageCanonicalEditPolicy.java:121)
at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolic ies(AbstractEditPart.java:165)
at org.eclipse.gef.editparts.AbstractEditPart.activate(Abstract EditPart.java:148)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate (AbstractGraphicalEditPart.java:193)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$0(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.activate(GraphicalEditPart.java:205)
at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart .activate(DiagramEditPart.java:349)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:201)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(Sim pleRootEditPart.java:101)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:601)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalVie wer.setContents(DiagramGraphicalViewer.java:378)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:610)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initi alizeGraphicalViewerContents(DiagramEditor.java:870)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initi alizeGraphicalViewer(DiagramEditor.java:863)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFl yOutPalette.initializeGraphicalViewer(DiagramEditorWithFlyOu tPalette.java:116)
at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.initializeGraphicalViewer(DiagramDocumen tEditor.java:175)
at org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor.initial izeGraphicalViewer(UMLDiagramEditor.java:242)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.creat eGraphicalViewer(DiagramEditor.java:807)
at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(G raphicalEditor.java:163)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.creat ePartControl(DiagramEditor.java:1555)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFl yOutPalette.createPartControl(DiagramEditorWithFlyOutPalette .java:328)
at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.createPartControl(DiagramDocumentEditor. java:1510)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:662)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:462)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:31 3)
at org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:778)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:677)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:638)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2854)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2762)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2754)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2705)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2701)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2685)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:344)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:192)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


At first I thought some reference in the CD file was referencing an incorrect/bad id in the UML model. However I did some cross checking and the references appear to match (there is no reference in the .umlclass file that does not appear in the .uml file).

So I'm stuck. Any ideas?

Cheers.
Re: Null Pointer Exception on class diagram opening [message #625315 is a reply to message #625314] Sun, 22 November 2009 08:28 Go to previous message
Kieran Simpson is currently offline Kieran SimpsonFriend
Messages: 10
Registered: November 2009
Junior Member
Doing some extra investigation, I found that the problem occurs if I create a template binding for a class in the UML editor, not the diagram editor. If I create the template binding through the diagram editor, the appropriate nodes are inserted into the UML model tree as if I did it myself. However upon reopening the diagram the diagram opens.

Subsequently there must be some data in the .umlclass file that Eclipse is expecting when parsing a template binding node in the UML model. When adding the binding with the diagram, obviously the diagram editor is adding the required XML, but when I add the template binding somethings missing.

I'm going to do some more looking around to see if I can narrow down the missing bit of XML.
Previous Topic:Null Pointer Exception on class diagram opening
Next Topic:Trouble using UML 2.1 Class Diagram Wizard (newbie)
Goto Forum:
  


Current Time: Mon Nov 24 20:19:24 GMT 2014

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

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