archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
152 stars 52 forks source link

On branch switching An error has occurred #120

Closed smirnoww closed 4 years ago

smirnoww commented 4 years ago

The message: "An error has occurred. See error log for more details. java.lang.NullPointerException" occured when I try to switch branch. Nonetheless I can switch branch via command line "git checkout myBranch"

Phillipus commented 4 years ago

We'll need more information than that to trace this.

Archi version? Plugin version? OS? Steps to reproduce? What's in the error log?

robinkeith2 commented 4 years ago

We've had something similar. In our case it was caused when the branch I was on had a canvas loaded from a template and I tried to merge another branch in. When I deleted that canvas from my views, O/S Windows 10 Archi version 4.6.0 build 201911111111 most recent version of the collab tool.

hope that helps track it down,

Here's the log, looks like its spitting on those canvas images

!ENTRY org.eclipse.jface 4 2 2020-03-09 15:53:47.362 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Unknown Source) at java.base/java.nio.file.Files.write(Unknown Source) at org.archicontribs.modelrepository.grafico.GraficoModelExporter.saveImages(GraficoModelExporter.java:279) at org.archicontribs.modelrepository.grafico.GraficoModelExporter.exportModel(GraficoModelExporter.java:116) at org.archicontribs.modelrepository.grafico.ArchiRepository.exportModelToGraficoFiles(ArchiRepository.java:379) at org.archicontribs.modelrepository.actions.SwitchBranchAction.run(SwitchBranchAction.java:62) at org.archicontribs.modelrepository.views.branches.BranchesView.lambda$0(BranchesView.java:137) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:777) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:774) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1092) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1205) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:251) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:249) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:308) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at com.archimatetool.editor.Application.start(Application.java:84) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) 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:660) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1468)

smirnoww commented 4 years ago

I found a way to cure this issue. Close Archi. Commit and push all changes via the git command line commands, if it is not pushed yet. then delete a local model folder. There is in C:\users\\AppData\Roaming\Archi4\model-repository\. And delete the model from C:\Users\\AppData\Roaming\Archi4\models.xml Then start Archi and pull remote repo again. It works for me

Phillipus commented 4 years ago

@smirnoww Looking at the trace I can see that when exporting the model to XML files and images, the bytes are null for an image. As to why I don't know. Can you reproduce this with a set of simple steps so that I can reproduce it?

Phillipus commented 4 years ago

Could be related to #125

smirnoww commented 4 years ago

I'll try to find a way for reproduce the bug

smirnoww commented 4 years ago

I found a way to cure this issue. Close Archi. Commit and push all changes via the git command line commands, if it is not pushed yet. then delete a local model folder. There is in C:\users\\AppData\Roaming\Archi4\model-repository. And delete the model from C:\Users\AppData\Roaming\Archi4\models.xml Then start Archi and pull remote repo again. It works for me

It doesn't work on my job premises, already. Error repeats after import of remote model to a workspace.

my conf: archi_configuration.txt and error log: archi_errorlog.txt

Now I have the error: dblClickError

I migrated my repo to GitHub to reproducing the bug on other computers. But when I import repo from GitHub, Model is still working fine

Have you any idea based on my error log?

Phillipus commented 4 years ago

Can you please try coArchi 0.6.0 beta

Link is here - https://github.com/archimatetool/archi-modelrepository-plugin/issues/129

smirnoww commented 4 years ago

additional... Status of local git repo changed after trying to switch branch. many files are deleted. archi_model_git_status.txt

smirnoww commented 4 years ago

I've updated coArchi. The error message is changed. archi_configuration2.txt archi_errorlog2.txt dblClickError2

Phillipus commented 4 years ago

You should reset the current branch with "Abort Uncommitted Changes" first.

smirnoww commented 4 years ago

thanks a lot. It seems to work now.

Phillipus commented 4 years ago

Should be fixed in 0.6.0. You might need to reset the current branch with "Abort Uncommitted Changes" first.

Phillipus commented 4 years ago

Close this as fixed. Please re-open if it does occur again, or create a new issue.