Cannot invoke due to "diagramModel" is null

Started by Xiaoqi, January 13, 2025, 02:29:28 AM

Previous topic - Next topic

Xiaoqi

Hello,

I've used Archi 5.5.0 (Build: 202312060902), today when I click one element, a Problem Occurred dialog pop-up with following error message:

An error has occurred. See error log for more details.
Cannot invoke "com.archimatetool.model.IDiagramModel.eAllContents()" because "diagramModel" is null

After close this error dialog, the Archi is still working fine, would like that you can kindly check if there's anything wrong in backend.

Regards, Xiaoqi

Xiaoqi

Additionally, here is the detail error log, for your troubleshooting reference:

!SESSION 2025-01-13 10:05:17.827 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.13
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -cleanConfig -eclipse.keyring @user.home/AppData/Roaming/Archi/secure_storage
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -cleanConfig -eclipse.keyring @user.home/AppData/Roaming/Archi/secure_storage

!ENTRY org.eclipse.jface 4 2 2025-01-13 10:21:43.061
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException: Cannot invoke "com.archimatetool.model.IDiagramModel.eAllContents()" because "diagramModel" is null
at com.archimatetool.editor.model.DiagramModelUtils.findDiagramModelObjectsForElementByIterator(DiagramModelUtils.java:133)
at com.archimatetool.editor.model.DiagramModelUtils.findDiagramModelObjectsForElement(DiagramModelUtils.java:111)
at com.archimatetool.editor.model.DiagramModelUtils.findDiagramModelComponentsForArchimateConcept(DiagramModelUtils.java:91)
at com.archimatetool.editor.diagram.ArchimateDiagramEditor.selectObjects(ArchimateDiagramEditor.java:145)
at com.archimatetool.editor.views.tree.TreeSelectionSynchroniser.selectionChanged(TreeSelectionSynchroniser.java:188)
at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2132)
at org.eclipse.jface.viewers.ColumnViewer.updateSelection(ColumnViewer.java:1055)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1170)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1199)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:262)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4285)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1160)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4083)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3673)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at com.archimatetool.editor.Application.start(Application.java:85)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
at org.eclipse.equinox.launcher.Main.run(Main.java:1481)

Phil Beauvoir

Hi, Xiaoqi

thanks for the report and the error log. With that I was able to find the problem. This is fixed in today's Early Access 5.5 build.

The cause depends on two things:

1. "Link to View" is on in the models tree
2. There is a "zombie" diagram editor part open

A "zombie" diagram editor part appears when you open Archi and the diagram editor part references a model file that has been deleted or renamed. Then you get the "This View is no longer available" message on the editor part. If "Link to View" is on then Archi will try to select elements in the zombie part that has no diagram model, and so this leads to a NullPointerException.

If you get those "zombie" editor parts, close them and the problem will not occur.

Anyway this is fixed in the latest 5.5 EA build.
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Xiaoqi

Thanks Phil for your quick checking and fixing.

In my original post, I've typo on the build date, it should be "Archi 5.5.0 (Build: 202412060902)".

While, I think the "zombie" diagram may be the ones of the diagram that still in tabs but the model has been closed (while not deleted I think).

I've now upgraded to your latest build: 202501131147, and will continue using and testing.

Thanks again,
Xiaoqi