archimatetool / archi-modelrepository-plugin

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

Null Pointer Exception on Commit #52

Closed robkamp closed 6 years ago

robkamp commented 6 years ago

I have a private github repository and while committing the model I get the following error in the log file.

This error occurs when starting on an empty git repository checked out to archi, while not having first added an empty local model to git.

`!SESSION 2018-02-19 14:38:08.848 ----------------------------------------------- eclipse.buildId=unknown java.version=1.8.0_144 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=nl_NL Framework arguments: -Djava.util.logging.config.file=C:/Archi-Win64-4.2/Archi/archi.log Command-line arguments: -os win32 -ws win32 -arch x86_64 -Djava.util.logging.config.file=C:/Archi-Win64-4.2/Archi/archi.log -clean

!ENTRY org.eclipse.ui 4 0 2018-02-19 14:43:52.173 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at com.archimatetool.editor.Application.start(Application.java:81) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) 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.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1499) Caused by: java.lang.NullPointerException at org.archicontribs.modelrepository.grafico.ArchiRepository.isHeadAndRemoteSame(ArchiRepository.java:324) at org.archicontribs.modelrepository.dialogs.CommitDialog.createDialogArea(CommitDialog.java:120) at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:158) at org.eclipse.jface.window.Window.create(Window.java:426) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096) at org.eclipse.jface.window.Window.open(Window.java:783) at org.archicontribs.modelrepository.actions.AbstractModelAction.offerToCommitChanges(AbstractModelAction.java:105) at org.archicontribs.modelrepository.actions.CommitModelAction.run(CommitModelAction.java:72) at org.archicontribs.modelrepository.actions.CommitModelHandler.execute(CommitModelHandler.java:29) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92) 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) ... 36 more `

Phillipus commented 6 years ago

Hi Rob, can you provide me with the exact steps to reproduce this so I can take a look at it?

Phillipus commented 6 years ago

This is caused by not having a "master" branch in the online git repo. I need to check what to do if that happens.

robkamp commented 6 years ago

Create an empty repository in GIT. Connect your local Archi to this repository. Do some changes. Try to commit. Nothing happens. No error on screen.

Op ma 19 feb. 2018 om 15:20 schreef Phil Beauvoir <notifications@github.com

:

Hi Rob, can you provide me with the exact steps to reproduce this so I can take a look at it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/archi-contribs/archi-modelrepository-plugin/issues/52#issuecomment-366706659, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0C6AikpkPL-YeZc-B50IFvDVzprUwNks5tWYNEgaJpZM4SKkzy .

--

Met vriendelijke groet,

Rob Kamp

Tel: +31 (0) 6 44874414

Phillipus commented 6 years ago

"Connect your local Archi to this repository." - what are you doing here? Can you give me exact steps, please? So far I can't reproduce this.

Phillipus commented 6 years ago

Never mind, I can reproduce it now.

Phillipus commented 6 years ago

Steps to reproduce:

  1. Create a blank repository on GitHub. Don't commit anything. We don't want a "master" branch yet.
  2. In Archi, in the Collaboration window, select "Import Remote Model to Workspace". Add the URL, user name, and password of the git repo and connect.
  3. Make some changes to the model in Archi.
  4. Try to commit these changes.

Nothing seems to happen, but a NPE is thrown.

robkamp commented 6 years ago

Hi Phil,

These are indeed the steps I took.

Cheers,

Rob Op ma 19 feb. 2018 om 16:17 schreef Phil Beauvoir notifications@github.com

Steps to reproduce:

  1. Create a blank repository on GitHub. Don't commit anything. We don't want a "master" branch yet.
  2. In Archi, in the Collaboration window, select "Import Remote Model to Workspace". Add the URL, user name, and password of the git repo and connect.
  3. Make some changes to the model in Archi.
  4. Try to commit these changes.

Nothing seems to happen, but a NPE is thrown.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/archi-contribs/archi-modelrepository-plugin/issues/52#issuecomment-366723023, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0C6OpT6X3ycxqFayVSkB5CLVw2Ae8-ks5tWZChgaJpZM4SKkzy .

--

Met vriendelijke groet,

Rob Kamp

Tel: +31 (0) 6 44874414

Phillipus commented 6 years ago

Rob, I've fixed this now, and a number of other issues that contributed to the problem. Please try the latest version https://www.archimatetool.com/plugins

robkamp commented 6 years ago

Hi Phil,

That's very quick! Thanks for the help. I'll give it a whirl later today and come back to you on the result.

Op di 20 feb. 2018 om 09:09 schreef Phil Beauvoir <notifications@github.com

:

Rob, I've fixed this now, and a number of other issues that contributed to the problem. Please try the latest version https://www.archimatetool.com/plugins

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/archi-contribs/archi-modelrepository-plugin/issues/52#issuecomment-366897155, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0C6AoFP0FBRbyd8UUsV2bFkuQ2eH95ks5tWn3MgaJpZM4SKkzy .

--

Met vriendelijke groet,

Rob Kamp

Tel: +31 (0) 6 44874414

Phillipus commented 6 years ago

Yes, please test. But test with the same set of conditions - i.e a raw online git repo with no master branch.

robkamp commented 6 years ago

Done the same way as before.

  1. Created an empty repository on github
  2. Imported that remote model to workspace
  3. Added an item to a drawing
  4. Committed the change
  5. Now I had to give a comment in the dialog box, to the commit (as expected)
  6. Published the changes
  7. Refreshed browser that pointed to the git repository
  8. The changes have been committed to the repo!

In short: the change you made fixed the problem. No more NPE and a commit dialog!

Phillipus commented 6 years ago

Thanks, Rob. I'll close this issue, but please open another issue if you find any more problems.