archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
966 stars 269 forks source link

Null pointer exception from saveModel when importing xmlexchange file #416

Closed brianjwilson closed 5 years ago

brianjwilson commented 5 years ago

I'm using the command line and it doesn't seem to write to the error log, but I'll paste in the console output.

Version of Archi, Operating System

macOS High Sierra 10.13.3 (17D47) com.archimatetool.editor.buildid=201809101333 com.archimatetool.editor.versionid=4.3.0

Expected Behaviour

XML Exchange Format files import cleanly if I use the Archi UI. I can also import the file successfully from the command line, but it crashes when I use the --saveModel flag as shown below and the file is not saved.

Actual Behaviour

[Core] Created empty model from template pathtotemplate.architemplate
[XML Exchange] Validating...
[XML Exchange] Validated!
[XML Exchange] Importing XML from pathto-exchange.xml
[XML Exchange] XML Imported!
java.lang.NullPointerException
    at com.archimatetool.commandline.providers.SaveModelProvider.saveModel(SaveModelProvider.java:77)
    at com.archimatetool.commandline.providers.SaveModelProvider.run(SaveModelProvider.java:63)
    at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:158)
    at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:79)
    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(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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)

Steps to Reproduce the Behaviour

  1. Take a simple .archimate model and export it to xml exchange format
  2. Attempt to import the file from the command line using syntax like this:

/Applications/Archi.app/Contents/MacOS/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --createEmptyModel "/pathtotemplate.architemplate" --xmlexchange.import "pathto-exchange.xml" --saveModel "pathtodestination.archimate"

You can see in the output that the actual import worked, only the save failed. Shout out to @Phillipus for being a Zappa fan and invoking the Central Scrutinizer.

Phillipus commented 5 years ago

Ugh. Thanks for reporting this.

This happens when importing the xml file in the exchange format and then saving. A couple of things are not set so it can't actually save. I've just committed a fix.

I think it's time to release a maintenance build of Archi...

Shout out to @Phillipus for being a Zappa fan and invoking the Central Scrutinizer.

The white zone is for loading and unloading only...

MilennialZero commented 5 years ago

"Call any vegetable. Call it by name. And the chances are good ..."

----- Original message ----- From: Phil Beauvoir notifications@github.com To: "archimatetool/archi" archi@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [archimatetool/archi] Null pointer exception from saveModel when importing xmlexchange file (#416)Date: Thu, 29 Nov 2018 14:21:14 -0800

Ugh. Thanks for reporting this.

This happens when importing the xml file in the exchange format and then saving. A couple of things are not set so it can't actually save. I've just committed a fix.I think it's time to release a maintenance build of Archi...

Shout out to @Phillipus[1] for being a Zappa fan and invoking the Central Scrutinizer.The white zone is for loading and unloading only...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub[2], or mute the thread[3].

Links:

  1. https://github.com/Phillipus
  2. https://github.com/archimatetool/archi/issues/416#issuecomment-443015663
  3. https://github.com/notifications/unsubscribe-auth/AdA9QuPWMVuxvuG1D-7QacvfdQGBSnXgks5u0F3agaJpZM4Y6ie0
Phillipus commented 5 years ago

"Call any vegetable. Call it by name. And the chances are good ..."

...that a vegetable will respond to you. ;-)

Phillipus commented 5 years ago

@brianjwilson Please try latest Archi 4.3.1 with a fix https://www.archimatetool.com/download/

brianjwilson commented 5 years ago

Thanks for the quick response on this, I'll give it a go here in a few and let you know how it works.

brianjwilson commented 5 years ago

4.3.1 works perfectly! Thanks!