testerui cannot run outside jsonata4java repo
maxandersen opened this issue · 2 comments
maxandersen commented
when running testerui outside the repo dir you get this error:
jbang -m com.api.jsonata4java.testerui.TesterUI com.ibm.jsonata4java:JSONata4Java:2.2.6:jar-with-dependencies
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.nio.file.NoSuchFileException: src/test/resources/exerciser/address.json
at com.api.jsonata4java.testerui.TesterUI$12.run(TesterUI.java:505)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.nio.file.NoSuchFileException: src/test/resources/exerciser/address.json
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
at com.api.jsonata4java.testerui.TesterUI.readFile(TesterUI.java:476)
at com.api.jsonata4java.testerui.TesterUI.<init>(TesterUI.java:116)
at com.api.jsonata4java.testerui.TesterUI$12.run(TesterUI.java:502)
... 13 more
should the UI not load from classpath or at least not fail when source json not found?
wnm3 commented
Will try to catch the exception and leave the text area empty if no address.json file can be found. Thanks.
wnm3 commented
I have released version 2.2.7 with the patch for not throwing an exception if no address.json can be found. If you agree this is fixed, please close this issue. The new jar should be in Maven Central in a couple of hours.