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)
Null Pointer Exception on class diagram opening [message #499410] 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.getContainedTypeModelFacetLinks_TemplateBinding_4016(UMLDiagramUpdater.java:4361)
	at org.eclipse.uml2.diagram.clazz.part.UMLDiagramUpdater.getClass_2001ContainedLinks(UMLDiagramUpdater.java:1869)
	at org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart.getClass_2001ContainedLinks(Class2EditPart.java:1889)
	at org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart.addSemanticListeners(Class2EditPart.java:1856)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:201)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy.refreshOnActivate(CanonicalConnectionEditPolicy.java:106)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:646)
	at org.eclipse.uml2.diagram.clazz.edit.policies.PackageCanonicalEditPolicy.activate(PackageCanonicalEditPolicy.java:121)
	at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:165)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:148)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:193)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart.activate(DiagramEditPart.java:349)
	at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:201)
	at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:101)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:601)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.setContents(DiagramGraphicalViewer.java:378)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:610)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewerContents(DiagramEditor.java:870)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewer(DiagramEditor.java:863)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.initializeGraphicalViewer(DiagramEditorWithFlyOutPalette.java:116)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.initializeGraphicalViewer(DiagramDocumentEditor.java:175)
	at org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor.initializeGraphicalViewer(UMLDiagramEditor.java:242)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createGraphicalViewer(DiagramEditor.java:807)
	at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(GraphicalEditor.java:163)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createPartControl(DiagramEditor.java:1555)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.createPartControl(DiagramEditorWithFlyOutPalette.java:328)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.createPartControl(DiagramDocumentEditor.java:1510)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)
	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(EditorSashContainer.java:63)
	at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
	at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
	at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778)
	at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677)
	at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2854)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)
	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685)
	at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:344)
	at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.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.java:3493)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	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(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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: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 #499419 is a reply to message #499410] 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:Generalization Set in the profile level
Next Topic:Null Pointer Exception on class diagram opening
Goto Forum:
  


Current Time: Mon Dec 22 07:18:58 GMT 2014

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

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