bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

HA-Bridge has suddenly given up itself - Exception in thread "main" java.lang.NullPointerException #1239

Closed jayjupdhig closed 3 years ago

jayjupdhig commented 3 years ago

Service command:

/usr/bin/java -jar -Dconfig.file=/opt/habridge/data/habridge.config /opt/habridge/ha-bridge.jar

cat /opt/habridge/data/habridge.config

{
  "broadlinkconfigured": false,
  "buttonsleep": 100,
  "domoticzconfigured": false,
  "farenheit": true,
  "fhemconfigured": false,
  "fibaroconfigured": false,
  "halconfigured": false,
  "harmonyconfigured": false,
  "hassconfigured": false,
  "homewizardconfigured": false,
  "hubversion": "9999999999",
  "hueconfigured": false,
  "lifxconfigured": false,
  "mqttconfigured": false,
  "myechourl": "echo.amazon.com/#cards",
  "nestconfigured": false,
  "numberoflogmessages": 512,
  "openhabconfigured": false,
  "serverport": "80",
  "settingsChanged": false,
  "somfyconfigured": false,
  "traceupnp": false,
  "upnpconfigaddress": "192.168.178.5",
  "upnpdevicedb": "/opt/habridge/data/device.db",
  "upnpgroupdb": "/opt/habridge/data/group.db",
  "upnpresponseport": 50000,
  "upnpsenddelay": 650,
  "upnpstrict": true,
  "userooms": false,
  "useupnpiface": false,
  "veraconfigured": false,
  "webaddress": "192.168.178.5",
  "upnporiginal": true
}

Output of first command:

2020-10-21 14:36:05,379 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge startup sequence...
2020-10-21 14:36:05,720 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0) initializing....
2020-10-21 14:36:05,727 [main] INFO  com.bwssystems.HABridge.BridgeSettings - reading from config file: /opt/habridge/data/habridge.config
Exception in thread "main" java.lang.NullPointerException
        at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
        at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
        at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
        at java.nio.file.Paths.get(Paths.java:84)
        at com.bwssystems.HABridge.BridgeSettings.buildSettings(BridgeSettings.java:228)
        at com.bwssystems.HABridge.HABridge.main(HABridge.java:58)

???

Thx for feedback.

Regards, Jan

jayjupdhig commented 3 years ago

For your info: Version is current release 5.3.0

jayjupdhig commented 3 years ago

JVM version on Rasbperry PI 3B+ With Debian 9: 1.8.0_265

jayjupdhig commented 3 years ago

Where can i get current master branch as a compiled .jar??

jayjupdhig commented 3 years ago

same problem with ha-bridge-5.3.1RC1.jar ...

jayjupdhig commented 3 years ago

That output message does say ABSOLUTE NOTHING - but i think the developers know what it is...(?)

jayjupdhig commented 3 years ago

@HA-Bridge developers: No idea what it is?

Thank you for your feedbacks...

With kind regards from Switzerland, Jan

bwssytems commented 3 years ago

Its just an info message that says the file path is not there yet. It is labeled as INFO and not ERROR or WARNING.

The bridge goes on after that, correct?

jayjupdhig commented 3 years ago

So closed. If you have any question regarding that issue, so please don't heistate to ask me. Thanks.

With kind regards from Switzerland, Jan

jayjupdhig commented 3 years ago

No...

It is NOT a memory card error!!!!

Still the same problem after a few days:


2020-11-04 17:06:49,092 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge startup sequence...
2020-11-04 17:06:49,468 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0) initializing....
2020-11-04 17:06:49,474 [main] INFO  com.bwssystems.HABridge.BridgeSettings - reading from config file: /opt/habridge/data/habridge.config
Exception in thread "main" java.lang.NullPointerException
        at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
        at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
        at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
        at java.nio.file.Paths.get(Paths.java:84)
        at com.bwssystems.HABridge.BridgeSettings.buildSettings(BridgeSettings.java:228)
        at com.bwssystems.HABridge.HABridge.main(HABridge.java:58)
jayjupdhig commented 3 years ago

Message with not existing config file is DIFFERENT, so it's COMPLETELY WRONG WHAT YOU TOLD ME:

/usr/bin/java -jar -Dconfig.file=/opt/habridge/data/habridge.config777 /opt/habridge/ha-bridge.jar
2020-11-04 17:07:12,121 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge startup sequence...
2020-11-04 17:07:12,495 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0) initializing....
2020-11-04 17:07:12,501 [main] INFO  com.bwssystems.HABridge.BridgeSettings - reading from config file: /opt/habridge/data/habridge.config777
2020-11-04 17:07:13,237 [main] INFO  spark.staticfiles.StaticFilesConfiguration - StaticResourceHandler configured with folder = /public
2020-11-04 17:07:13,307 [main] INFO  com.bwssystems.HABridge.SystemControl - System control service started....
2020-11-04 17:07:13.415:INFO::Thread-0: Logging initialized @2466ms to org.eclipse.jetty.util.log.StdErrLog
2020-11-04 17:07:13,436 [main] INFO  com.bwssystems.HABridge.util.UDPDatagramSender - Initializing UDP response Socket...
2020-11-04 17:07:13,444 [main] INFO  com.bwssystems.HABridge.util.UDPDatagramSender - UDP response Socket initialized to: 50000
2020-11-04 17:07:13,456 [main] INFO  com.bwssystems.HABridge.plugins.http.HTTPHome - HTTP Home created.
2020-11-04 17:07:13,470 [main] INFO  com.bwssystems.HABridge.plugins.harmony.HarmonyHome - Harmony Home created. No Harmony devices configured.
2020-11-04 17:07:13,475 [main] INFO  com.bwssystems.HABridge.plugins.NestBridge.NestHome - Nest Home created. No Nest configured.
2020-11-04 17:07:13,478 [main] INFO  com.bwssystems.HABridge.plugins.hue.HueHome - Hue passthru Home created. No Hue passtrhu systems configured.
2020-11-04 17:07:13,483 [main] INFO  com.bwssystems.HABridge.plugins.hal.HalHome - HAL Home created. No HAL devices configured.
2020-11-04 17:07:13,487 [main] INFO  com.bwssystems.HABridge.plugins.mqtt.MQTTHome - MQTT Home created. No MQTT Clients configured.
2020-11-04 17:07:13,491 [main] INFO  com.bwssystems.HABridge.plugins.hass.HassHome - HomeAssistant Home created. No HomeAssistants configured.
2020-11-04 17:07:13,495 [main] INFO  com.bwssystems.HABridge.plugins.homewizard.HomeWizardHome - HomeWizard Home created. No HomeWizard gateways configured.
2020-11-04 17:07:13,498 [main] INFO  com.bwssystems.HABridge.plugins.exec.CommandHome - Command Home for system program execution created.
2020-11-04 17:07:13,502 [main] INFO  com.bwssystems.HABridge.plugins.tcp.TCPHome - TCP Home created.
2020-11-04 17:07:13,508 [main] INFO  com.bwssystems.HABridge.plugins.udp.UDPHome - UDP Home created.
2020-11-04 17:07:13,512 [main] INFO  com.bwssystems.HABridge.plugins.vera.VeraHome - Vera Home created. No Veras configured.
2020-11-04 17:07:13,515 [main] INFO  com.bwssystems.HABridge.plugins.fibaro.FibaroHome - Fibaro Home created. No Fibaros configured.
2020-11-04 17:07:13,520 [main] INFO  com.bwssystems.HABridge.plugins.domoticz.DomoticzHome - Domoticz Home created. No Domoticz devices configured.
2020-11-04 17:07:13,523 [main] INFO  com.bwssystems.HABridge.plugins.somfy.SomfyHome - Somfy Home created.  No Somfys configured.
2020-11-04 17:07:13,530 [main] INFO  com.bwssystems.HABridge.plugins.lifx.LifxHome - LifxDevice Home created. No LifxDevices configured.
2020-11-04 17:07:13,534 [main] INFO  com.bwssystems.HABridge.plugins.openhab.OpenHABHome - OpenHAB Home created. No OpenHABs configured.
2020-11-04 17:07:13,539 [main] INFO  com.bwssystems.HABridge.plugins.fhem.FHEMHome - FHEM Home created. No FHEMs configured.
2020-11-04 17:07:13,549 [main] INFO  com.bwssystems.HABridge.plugins.broadlink.BroadlinkHome - Broadlink Home created. No Broadlinks configured.
2020-11-04 17:07:13,570 [main] INFO  com.bwssystems.HABridge.plugins.moziot.MozIotHome - Mozilla IOT Home created. No Mozilla IOTs configured.
2020-11-04 17:07:13,575 [main] INFO  com.bwssystems.HABridge.plugins.homegenie.HomeGenieHome - HomeGenie Home created. No HomeGenies configured.
2020-11-04 17:07:13,589 [main] WARN  com.bwssystems.HABridge.dao.DeviceRepository - Error reading the file: data/device.db - Does not exist or is not readable. continuing...
2020-11-04 17:07:13,594 [main] INFO  com.bwssystems.HABridge.devicemanagmeent.DeviceResource - HABridge device management service started....
2020-11-04 17:07:13,668 [Thread-0] INFO  spark.embeddedserver.jetty.EmbeddedJettyServer - == Spark has ignited ...
2020-11-04 17:07:13,671 [Thread-0] INFO  spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:80
2020-11-04 17:07:13.687:INFO:oejs.Server:Thread-0: jetty-9.4.z-SNAPSHOT, build timestamp: 2017-11-21T22:27:37+01:00, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
2020-11-04 17:07:13,703 [main] INFO  com.bwssystems.HABridge.hue.HueMulator - Hue emulator service started....
2020-11-04 17:07:13.806:INFO:oejs.session:Thread-0: DefaultSessionIdManager workerName=node0
2020-11-04 17:07:13.809:INFO:oejs.session:Thread-0: No SessionScavenger set, using defaults
2020-11-04 17:07:13.821:INFO:oejs.session:Thread-0: Scavenging every 660000ms
2020-11-04 17:07:13,852 [Thread-0] ERROR com.bwssystems.HABridge.HABridge - Could not start ha-bridge webservice on port [80] due to: Die Adresse wird bereits verwendet
2020-11-04 17:07:13,856 [Thread-0] WARN  com.bwssystems.HABridge.HABridge - {"control":"stopping"}
2020-11-04 17:07:13,860 [main] INFO  com.bwssystems.HABridge.upnp.UpnpSettingsResource - Description xml service started....
2020-11-04 17:07:13,882 [main] WARN  com.bwssystems.HABridge.upnp.UpnpListener - UPNP Listener exiting as reinit or stop requested....
2020-11-04 17:07:13,883 [main] INFO  com.bwssystems.HABridge.HABridge - Going to close all homes
2020-11-04 17:07:13,884 [main] INFO  com.bwssystems.HABridge.HomeManager - Manager close homes called....
2020-11-04 17:07:13,885 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.tcp.TCPHome
2020-11-04 17:07:13,885 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.NestBridge.NestHome
2020-11-04 17:07:13,886 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hal.HalHome
2020-11-04 17:07:13,886 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.NestBridge.NestHome
2020-11-04 17:07:13,887 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.lifx.LifxHome
2020-11-04 17:07:13,887 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.somfy.SomfyHome
2020-11-04 17:07:13,888 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.moziot.MozIotHome
2020-11-04 17:07:13,888 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,889 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.openhab.OpenHABHome
2020-11-04 17:07:13,889 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hal.HalHome
2020-11-04 17:07:13,890 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.homewizard.HomeWizardHome
2020-11-04 17:07:13,890 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.fhem.FHEMHome
2020-11-04 17:07:13,890 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,890 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.udp.UDPHome
2020-11-04 17:07:13,891 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hal.HalHome
2020-11-04 17:07:13,891 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.broadlink.BroadlinkHome
2020-11-04 17:07:13,891 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.exec.CommandHome
2020-11-04 17:07:13,891 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,891 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hass.HassHome
2020-11-04 17:07:13,892 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.harmony.HarmonyHome
2020-11-04 17:07:13,892 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hal.HalHome
2020-11-04 17:07:13,892 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.homegenie.HomeGenieHome
2020-11-04 17:07:13,892 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.udp.UDPHome
2020-11-04 17:07:13,893 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.hue.HueHome
2020-11-04 17:07:13,893 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.harmony.HarmonyHome
2020-11-04 17:07:13,893 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.tcp.TCPHome
2020-11-04 17:07:13,893 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,893 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.mqtt.MQTTHome
2020-11-04 17:07:13,894 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.domoticz.DomoticzHome
2020-11-04 17:07:13,894 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,894 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.exec.CommandHome
2020-11-04 17:07:13,894 [main] INFO  com.bwssystems.HABridge.HomeManager - Closing home: com.bwssystems.HABridge.plugins.http.HTTPHome
2020-11-04 17:07:13,897 [Thread-10] INFO  spark.embeddedserver.jetty.EmbeddedJettyServer - >>> Spark shutting down ...
2020-11-04 17:07:13.926:INFO:oejs.AbstractConnector:Thread-10: Stopped ServerConnector@815be5{HTTP/1.1,[http/1.1]}{0.0.0.0:80}
2020-11-04 17:07:13.928:INFO:oejs.session:Thread-10: Stopped scavenging
2020-11-04 17:07:13,934 [Thread-10] INFO  spark.embeddedserver.jetty.EmbeddedJettyServer - done
2020-11-04 17:07:14,918 [main] INFO  com.bwssystems.HABridge.plugins.http.HttpClientPool - Shutting down client pool
2020-11-04 17:07:14,921 [main] INFO  com.bwssystems.HABridge.plugins.http.HttpClientPool - Client pool shut down
2020-11-04 17:07:14,933 [main] INFO  com.bwssystems.HABridge.plugins.http.HttpClientPool - Instantiated SSL components.
2020-11-04 17:07:14,937 [main] INFO  com.bwssystems.HABridge.plugins.http.HttpClientPool - Shutting down client pool
2020-11-04 17:07:14,937 [main] INFO  com.bwssystems.HABridge.plugins.http.HttpClientPool - Client pool shut down
2020-11-04 17:07:14,938 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0) exiting....
2020-11-04 17:07:14,941 [Thread-1] INFO  com.bwssystems.HABridge.ShutdownHook - Shutdown requested...
2020-11-04 17:07:14,942 [Thread-1] INFO  com.bwssystems.HABridge.ShutdownHook - Already stopped
jayjupdhig commented 3 years ago

Here is the file as an original (not pasted as text) because os possible encoding problems or whatever WTF is is?!?!!

habridge.zip

jayjupdhig commented 3 years ago

Same problem with a copy of the file:

/usr/bin/java -jar -Dconfig.file=/opt/habridge/data/habridge.config.2 /opt/habridge/ha-bridge.jar
jayjupdhig commented 3 years ago

That's the line where it crashes:

` setupParams(Paths.get(theBridgeSettings.getConfigfile()), ".cfgbk", "habridge.config-"); ``

BridgeSettings.java on line 228 ...

WTF is that crap?!?!

jayjupdhig commented 3 years ago

https://github.com/bwssytems/ha-bridge/issues/1246

jayjupdhig commented 3 years ago

https://github.com/bwssytems/ha-bridge/issues/1245

jayjupdhig commented 3 years ago

java -version openjdk version "1.8.0_265" OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0+deb9u1-b01) OpenJDK Client VM (build 25.265-b01, mixed mode)

jayjupdhig commented 3 years ago

Same problem with newer java version

 java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment (build 1.8.0_272-8u272-b10-0+deb9u1-b10)
OpenJDK Client VM (build 25.272-b10, mixed mode)
jayjupdhig commented 3 years ago

Now i installed openjdk 9, still no success.

jayjupdhig commented 3 years ago

command:

/usr/bin/java -jar -Dconfig.file=/opt/habridge/data/habridge.config /opt/habridge/ha-bridge.jar
2020-11-05 11:43:19,820 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge startup sequence...
2020-11-05 11:43:19,959 [main] INFO  com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0) initializing....
2020-11-05 11:43:19,966 [main] INFO  com.bwssystems.HABridge.BridgeSettings - reading from config file: /opt/habridge/data/habridge.config
Exception in thread "main" java.lang.NullPointerException
        at java.base/sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:75)
        at java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
        at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:280)
        at java.base/java.nio.file.Paths.get(Paths.java:84)
        at com.bwssystems.HABridge.BridgeSettings.buildSettings(BridgeSettings.java:228)
        at com.bwssystems.HABridge.HABridge.main(HABridge.java:58)
jayjupdhig commented 3 years ago

java version

java -version
openjdk version "9-Raspbian"
OpenJDK Runtime Environment (build 9-Raspbian+0-9b181-4bpo9rpt1)
OpenJDK Server VM (build 9-Raspbian+0-9b181-4bpo9rpt1, mixed mode)
jayjupdhig commented 3 years ago
cat /opt/habridge/data/habridge.config
{
  "broadlinkconfigured": false,
  "buttonsleep": 100,
  "domoticzconfigured": false,
  "farenheit": true,
  "fhemconfigured": false,
  "fibaroconfigured": false,
  "halconfigured": false,
  "harmonyconfigured": false,
  "hassconfigured": false,
  "homewizardconfigured": false,
  "hubversion": "9999999999",
  "hueconfigured": false,
  "lifxconfigured": false,
  "mqttconfigured": false,
  "myechourl": "echo.amazon.com/#cards",
  "nestconfigured": false,
  "numberoflogmessages": 512,
  "openhabconfigured": false,
  "serverport": "80",
  "settingsChanged": false,
  "somfyconfigured": false,
  "traceupnp": false,
  "upnpconfigaddress": "192.168.178.5",
  "upnpdevicedb": "/opt/habridge/data/device.db",
  "upnpgroupdb": "/opt/habridge/data/group.db",
  "upnpresponseport": 50000,
  "upnpsenddelay": 650,
  "upnpstrict": true,
  "userooms": false,
  "useupnpiface": false,
  "veraconfigured": false,
  "webaddress": "192.168.178.5",
  "upnporiginal": true
}

WTF is that s**t?!??!

jayjupdhig commented 3 years ago

Please contact me via PM, so i can see you are interested or not (which seems to be, at least i.m.o) to prevent that behavior (maybe for future users) by fixing that bug.

You can also contact me via habridge-bug-2 (AT) crapmail.org ...

(habridge-bug-2 (AT) crapmail.org which is a redirect to my inbox is exactly active for 1 month from yesterday...)

If you have any questions regarding that issue, so please don't hesitate to contact me - youre welcome!! ;-)

jayjupdhig commented 3 years ago

Re-opened...

jayjupdhig commented 3 years ago

No anwser?? Maybe you can put my fix into the future 5.3.1 Release Version...?

So don't hesitate to contact me...!!

jayjupdhig commented 3 years ago

https://github.com/bwssytems/ha-bridge/issues/1247

kosuodhmwa commented 3 years ago

Same problem here!!

bwssytems commented 3 years ago

So, what user is starting the ha-bridge? Does it have read/write access to the file that is being specified?

bwssytems commented 3 years ago

This is due to loading the config file and the configfile parameter is not set. If a path is given on the command line, it should just use that path after the config file load.

bwssytems commented 3 years ago

A quick work around until the new jar is released is to set the configfile parameter in the habridge.config file to the path you put on the command line.

kosuodhmwa commented 3 years ago

I used that command, as i wrote in the 1st post:

/usr/bin/java -jar -Dconfig.file=/opt/habridge/data/habridge.config /opt/habridge/ha-bridge.jar

I start it as root. The config file exists. Facts...

That hotfix helped me to solve the problem:

private void _loadConfig(final Path aPath) {
        final String jsonContent = this.configReader(aPath);
        if (jsonContent == null) {
            return;
        }
        try {
            this.theBridgeSettings = (new Gson()).fromJson(jsonContent, BridgeSettingsDescriptor.class);

            // J.M., Hotfix, 2020-11-05 {
            if (this.theBridgeSettings.getConfigfile() == null) {
                throw new Exception();
            }
            // } J.M., Hotfix, 2020-11-05

        } catch (final Exception e) {
            BridgeSettings.log.warn("Issue loading values from file: " + aPath.toUri().toString() + ", Gson convert failed.");
            this.theBridgeSettings = new BridgeSettingsDescriptor();
            this.theBridgeSettings.setConfigfile(aPath.toString());
        }
    }

I don't know, but maybe the current JVM on Raspbian Stretch is not compatible to GSON??

I get a NULL instance from this.theBridgeSettings.getConfigfile(), it does NOT catch an exception.

So the "alternative" way on the last line in the catch block does make it work.

Maybe you can investigate a lil bit closer, and maybe you can make a fix of that issue in the next version 5.3.1 ?

bwssytems commented 3 years ago

Sorry, for the confusion. You don't need to update any code to make this work with the original jar.... add a line in the habridge.config as follows:

"configfile": "/opt/habridge/data/habridge.config"

kosuodhmwa commented 3 years ago

This is my personal account.

OK, if the config file points to its own path, then it would work? I think that's also a workaround. (?)

Will that issue be fixed in the next 5.3.1 release?

(I will try it when i'm on work on monday)

Thank you very much.

jayjupdhig commented 3 years ago

Thanks in advance for your feedback! :-)

bwssytems commented 3 years ago

This will be fixed in the next RC jar

jayjupdhig commented 3 years ago

ok thx

bwssytems commented 3 years ago

This is now in the new RC3 jar

jayjupdhig commented 3 years ago

thx, will try it ASAP!!