archimatetool / archi-modelrepository-plugin

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

ACLI CSV NPE [Caused by no Command Stack created on Load Model] #107

Closed jim-schilling closed 5 years ago

jim-schilling commented 5 years ago

Version of Archi, Operating System

Archi 4.4.0 Build 201904031131 Windows 10 Enterprise

Expected Behaviour

Command line import of CSV to Repository Model

Actual Behaviour

Null pointer exception is thrown at startup of Archi

Steps to Reproduce the Behaviour

  1. Run Archi command to export Repository model
  2. Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.loadModel c:\archi-repos\reference-model --csv.export c:\data
  3. Run Archi command to import CSV to Repository model
  4. Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.loadModel c:\archi-repos\reference-model --csv.import c:\data\elements.csv

Here's the output from Import command:

[LoadModelFromRepositoryProvider] Loading model at c:\archi-repos\reference-model [LoadModelFromRepositoryProvider] Loaded model: 'Reference Model' [CSV] Importing csv from c:\data\elements.csv to 'Reference Model' java.lang.NullPointerException at com.archimatetool.csv.importer.CSVImporter.doImport(CSVImporter.java:109) at com.archimatetool.csv.commandline.ImportCSVProvider.run(ImportCSVProvider.java:70) at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:159) at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:80) 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)

Phillipus commented 5 years ago

Thanks for reporting.

Can you download version 0.5.2 of the Collaboration plug-in and let me know if it fixes the problem?

https://www.archimatetool.com/plugins/

jim-schilling commented 5 years ago

That fixed the null pointer issue ... the CSV import operation works as expected now.

Is there a command line switch to save the repository model after a CSV import? I ran another test using an elements.csv with changes, these are not reflected in the repository model.

When running a command line CSV import for a standard *.archimate model, I have to use a --saveModel option to have the changes saved.

Phillipus commented 5 years ago

Is there a command line switch to save the repository model after a CSV import?

You can, as you say, save the model if you know the exact path and file name but with the model repository you need also to commit and push changes. These are not part of the CLI.

Phillipus commented 5 years ago

Moved to archi-modelrepository-plugin

Phillipus commented 5 years ago

I'll close this as the original bug is fixed.