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

[hyperion] Binding not working due to NPE in HyperionNgHandler #6377

Closed
petterkatt opened this issue Nov 11, 2019 · 2 comments · Fixed by #7898
Closed

[hyperion] Binding not working due to NPE in HyperionNgHandler #6377

petterkatt opened this issue Nov 11, 2019 · 2 comments · Fixed by #7898
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@petterkatt
Copy link

Expected Behavior

Thing shows up as online, however Im unable to control my Hyperion-ng server using OpenHAB.
Tested using both thing and item files as well as PaperUI.

Current Behavior

Following shows up in the log:

2019-11-11 19:18:00.826 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.NullPointerException: null

	at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler.updateHyperion(HyperionNgHandler.java:260) ~[?:?]

	at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler.handleServerInfoResponse(HyperionNgHandler.java:178) ~[?:?]

	at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler$1.run(HyperionNgHandler.java:103) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Steps to Reproduce (for Bugs)

  1. Install binding
  2. Set up Thing
  3. Try to control Hyperion-ng

Your Environment

  • Version used: 2.5.0M4 (Both OpenHAB and Hyperion Binding)
  • Environment name and version (openjdk version "1.8.0_232")
    OpenJDK Runtime Environment (Zulu 8.42.0.23-CA-linux64) (build 1.8.0_232-b18)
    OpenJDK 64-Bit Server VM (Zulu 8.42.0.23-CA-linux64) (build 25.232-b18, mixed mode)
  • Operating System and version (Ubuntu 18.04.3 LTS):
@petterkatt petterkatt added the bug An unexpected problem or unintended behavior of an add-on label Nov 11, 2019
@wborn wborn changed the title [Hyperion] binding not working [hyperion] Binding not working due to NPE in HyperionNgHandler Nov 17, 2019
@wborn
Copy link
Member

wborn commented Nov 17, 2019

posseydon6891 added a commit to posseydon6891/openhab-addons that referenced this issue Jun 11, 2020
Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL". See: https://docs.hyperion-project.org/en/json/ServerInfo.html

Signed-off-by: Łukasz Serwicki <[email protected]>
@posseydon6891
Copy link

Hi,

I just hit this issue while migrating from hyperion to hyperionNG, alpha6 release. NPE can be seen in OH log and no state updates follow:

2020-06-10 22:50:58.777 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: null
        at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler.updateHyperion(HyperionNgHandler.java:260) ~[?:?]
        at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler.handleServerInfoResponse(HyperionNgHandler.java:178) ~[?:?]
        at org.openhab.binding.hyperion.internal.handler.HyperionNgHandler$1.run(HyperionNgHandler.java:103) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_232]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_232]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_232]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

As Daniel (@tavalin) discussed in 97747, Hyperion API was changed and the "hyperion" object seems to be missing in serverInfo response (hence NPE after deserialization). Example response from my NG server: serverInfo.txt

According to API docs, now HyperionNG state "as a whole" is handled by special component called "ALL".

Screenshot_20200611_180323

For test, I removed the channel "state" logic from "updateHyperion" and added it to "updateComponent" in HyperionNgHandler.java, rebuilt binding and now testing it. If it works, I will try to go ahead with PR.

posseydon6891 added a commit to posseydon6891/openhab-addons that referenced this issue Jun 11, 2020
Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL". See: https://docs.hyperion-project.org/en/json/ServerInfo.html

Signed-off-by: posseydon6891 <[email protected]>
@cpmeister cpmeister linked a pull request Jun 11, 2020 that will close this issue
posseydon6891 added a commit to posseydon6891/openhab-addons that referenced this issue Jun 15, 2020
Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

Signed-off-by: posseydon6891 <[email protected]>
cpmeister pushed a commit that referenced this issue Jun 15, 2020
* [hyperion] Fixes #6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this issue Jul 12, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this issue Jul 26, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
* [hyperion] Fixes openhab#6377 hyperion NPE

Incorporate changes to HyperionNG serverInfo API - alpha6.
HyperionEnabled state channel is now determined by special component
state "ALL" for newer APIs.

See: https://docs.hyperion-project.org/en/json/ServerInfo.html

* Update bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java

Signed-off-by: Łukasz Serwicki <[email protected]>
Co-authored-by: Connor Petty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants