hapifhir / hapi-hl7v2

282 stars 137 forks source link

Test panel 2.5.1 doesn't run on linux #117

Closed ppazos closed 6 months ago

ppazos commented 8 months ago

It seems test panel has a hardcoded dependency to OSX: error in OSXInitializer

hapi-testpanel-2.5.1  $ ./testpanel.sh
15:01:45,227  INFO [main] Home:47 - hapi.home is set to /home/pablo/Downloads/hapi-testpanel-2.5.1/.
15:01:46,321 ERROR [main] Prefs:485 - Failed to restore file "": jakarta.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.]
jakarta.xml.bind.DataBindingException: jakarta.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.]
    at jakarta.xml.bind.JAXB.unmarshal(JAXB.java:221)
    at ca.uhn.hl7v2.testpanel.controller.Prefs.initFromJavaPrefs(Prefs.java:483)
    at ca.uhn.hl7v2.testpanel.controller.Prefs.getInstance(Prefs.java:809)
    at ca.uhn.hl7v2.testpanel.model.conf.TableFileList.<init>(TableFileList.java:25)
    at ca.uhn.hl7v2.testpanel.controller.Controller.<init>(Controller.java:126)
    at ca.uhn.hl7v2.testpanel.App.main(App.java:63)
Caused by: jakarta.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.]
    at jakarta.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:290)
    at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:539)
    at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:224)
    at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:196)
    at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:251)
    at jakarta.xml.bind.JAXB.unmarshal(JAXB.java:218)
    ... 5 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1465)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1013)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
    at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:218)
    ... 8 more
15:01:46,333  INFO [main] Controller:151 - No saved outbound connection list found
15:01:46,345  INFO [main] Controller:166 - No saved inbound connection list found
Exception in thread "main" java.lang.UnsupportedOperationException: The APP_ABOUT action is not supported on the current platform!
    at java.desktop/java.awt.Desktop.checkActionSupport(Desktop.java:380)
    at java.desktop/java.awt.Desktop.setAboutHandler(Desktop.java:696)
    at ca.uhn.hl7v2.testpanel.OSXInitializer.run(OSXInitializer.java:52)
    at ca.uhn.hl7v2.testpanel.App.main(App.java:65)
ppazos commented 8 months ago

It seems this change made the test panel depend on OSX while before it handled linux and win correctly

https://github.com/hapifhir/hapi-hl7v2/commit/1d0c03ec9c14c6780a1d12174ffcdf8f64b01027#diff-dc8b4ce414d5d884c31fd6a8431fb9d9e1c6f44103d3776e8ab7164d5786afa4L64-R65

FlorianBonte-Moonchase commented 8 months ago

The same goes for Windows as well.

I solved it by simply putting a try-catch around the two if-blocks in OSXInitializer as to ignore the unsupported operations, but that doesn't seem like a good solution.

ppazos commented 8 months ago

@FlorianBonte-Moonchase I think it should be rolled back to the change I mentioned in the previous comment that seemed to support all platforms not only OsX. I believe the developers have Macs and didn't test on Linux or win.