archimatetool / archi

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

Create HTML report from command line fails with specialization with image #793

Closed slamer59 closed 2 years ago

slamer59 commented 2 years ago

Version of Archi

4.9.1 Build: 2021110260902

Archi Plug-ins

coArchi but not sure it is relevant

Operating System

Windows / Linux (also fails this image with https://github.com/yoep/docker-archimate)

Expected Behaviour

The GUI is working as expected.

Actual Behaviour

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0
        at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
        at com.archimatetool.editor.model.impl.EditorModelManager.loadModel(EditorModelManager.java:290)
        at com.archimatetool.commandline.providers.LoadModelFromFileProvider.run(LoadModelFromFileProvider.java:58)
        at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
        at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        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:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
java.io.IOException: Model was not loaded
        at com.archimatetool.reports.commandline.HTMLReportProvider.run(HTMLReportProvider.java:66)
        at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
        at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        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:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

Steps to Reproduce the Behaviour

  1. Add an image for a specialization & Save the model
  2. "C:\Program Files\Archi4\Archi.exe" -application com.archimatetool.commandline.app -consoleLog -nosplash --loadModel ./model.archimate --html.createReport ./public -p
Phillipus commented 2 years ago

Works for me.

Things to try:

  1. Use absolute paths in quotes (--loadModel "path_to/model.archimate")
  2. Ensure the model opens in Archi itself and hasn't been modified outside of Archi
  3. Try a different model

The stack trace shows that the problem is with loading the model.

slamer59 commented 2 years ago

Thanks ! It works with the absolute path.

As a summary:

Thanks for the workaround. :)

Phillipus commented 2 years ago

I checked the code for this, and found a discrepancy in the way file paths are created. So this should be fixed in the next version so that relative paths will work in both cases.