VISAB-ORG / VISAB

VISAB is a standalone utility to visualize artificial intelligence agent behavior in games.
1 stars 0 forks source link

Default settings cannot be loaded when running as JAR #59

Closed leRoe93 closed 3 years ago

leRoe93 commented 3 years ago

Somehow loading the settings from within the JAR currently does not work properly, see below stacktrace:

[INFO ] 2021-06-13 20:37:07,390 - Valid execution mode 'gui' for VISAB detected
[INFO ] 2021-06-13 20:37:07,393 - Starting VISAB API HTTP server ...
[INFO ] 2021-06-13 20:37:07,399 - User settings do not exist yet, loading defaults.
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:/D:/EclipseWorkspace/VISAB/target/VISAB-0.0.1-SNAPSHOT.jar!/configs/defaultSettings.json
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
        at java.base/java.nio.file.Path.of(Path.java:147)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at org.visab.workspace.RepositoryBase.readFileContents(RepositoryBase.java:95)
        at org.visab.workspace.config.ConfigManager.loadSettings(ConfigManager.java:177)
        at org.visab.workspace.config.ConfigManager.<init>(ConfigManager.java:40)
        at org.visab.workspace.Workspace.<init>(Workspace.java:34)
        at org.visab.workspace.Workspace.getInstance(Workspace.java:29)
        at org.visab.api.WebApi.<init>(WebApi.java:54)
        at org.visab.api.WebApi.getInstance(WebApi.java:42)
        at org.visab.main.Main.doMain(Main.java:59)
        at org.visab.main.Main.main(Main.java:30)

This has something to do with the resourcepath, we should fix this at some point :)