Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jayjupdhig opened this issue Oct 21, 2020 · 37 comments · Fixed by #1266

Comments

@jayjupdhig
Copy link

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
Copy link
Author

For your info: Version is current release 5.3.0

@jayjupdhig
Copy link
Author

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

@jayjupdhig
Copy link
Author

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

@jayjupdhig
Copy link
Author

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

@jayjupdhig
Copy link
Author

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

@jayjupdhig
Copy link
Author

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

Thank you for your feedbacks...

With kind regards from Switzerland,
Jan

@bwssytems
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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 jayjupdhig reopened this Nov 4, 2020
@jayjupdhig
Copy link
Author

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
Copy link
Author

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

habridge.zip

@jayjupdhig
Copy link
Author

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
Copy link
Author

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
Copy link
Author

#1246

@jayjupdhig
Copy link
Author

#1245

@jayjupdhig
Copy link
Author

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
Copy link
Author

jayjupdhig commented Nov 4, 2020

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
Copy link
Author

Now i installed openjdk 9, still no success.

@jayjupdhig
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Re-opened...

@jayjupdhig jayjupdhig reopened this Nov 6, 2020
@jayjupdhig
Copy link
Author

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

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

@jayjupdhig
Copy link
Author

#1247

@kosuodhmwa
Copy link

Same problem here!!

@bwssytems
Copy link
Owner

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

@bwssytems bwssytems added the bug label Nov 19, 2020
@bwssytems
Copy link
Owner

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 bwssytems added this to the 5.3.1 milestone Nov 19, 2020
@bwssytems
Copy link
Owner

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
Copy link

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
Copy link
Owner

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
Copy link

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
Copy link
Author

Thanks in advance for your feedback! :-)

@bwssytems
Copy link
Owner

This will be fixed in the next RC jar

@jayjupdhig
Copy link
Author

ok thx

@bwssytems
Copy link
Owner

This is now in the new RC3 jar

@jayjupdhig
Copy link
Author

thx, will try it ASAP!!

bwssytems added a commit that referenced this issue Dec 14, 2020
Dev branch 5.3.x to create v5.4.0

#1044 Alexa app, error "Device doesn't support requested value" bug question
#1118 Device status update in Alexa App is not working correctly for ha-bridge devices bug duplicate question
#1126 Can't get XY ColorData into URL enhancement question
#1127 Can't get separate hue, saturation and brightness enhancement question
#1128 Wrong color calucation in HS mode bug question
#1131 Changing color temperatur is not working correctly bug question
#1132 Conversion from CIE to RGB incorrect bug question
#1139 Device ID creation fails bug question
#1150 Home Assistant gets null exception during initialization bug question
#1170 Alexa not sending the correct color codes duplicate
#1171 Please add option: If bright request present with on, only send dim enhancement
#1184 Alexa will not discover HABridge question
#1191 When "Use UPNP Address Interface Only" is selected, echo cannot find ha-bridge bug
#1210 [Enahnacement] Have link button timeout be configurable enhancement
#1215 Alexa unable to discover recently added devices to ha-bridge duplicate question
#1227 Feature request: ${intensity.previous} value passing control enhancement
#1239 HA-Bridge has suddenly given up itself - Exception in thread "main" java.lang.NullPointerException bug question
#1243 Alexa device discovery now broke question
#1253 HABridge hue ColorDecode 0 0 0 bug question
#1256 Homeassistant devices not appearing bug question
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants