Feed binding Null Pointer Exception

I installed Feed binding today. After a few hours got a Null Pointer Exception.
I’m in OH V2.4 Raspberry Pi 3.

My log:

2018-12-23 21:24:40.118 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NullPointerException: null

at java.util.Calendar.setTime(Calendar.java:1770) ~[?:?]

at org.openhab.binding.feed.internal.handler.FeedHandler.publishChannelIfLinked(FeedHandler.java:153) ~[?:?]

at org.openhab.binding.feed.internal.handler.FeedHandler.refreshFeedState(FeedHandler.java:113) ~[?:?]

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) [?:?]

Maybe something I did wrong, but I tried to follow the docs.

My items:

String latest_title {channel=“feed:feed:c057385c:latest-title”}
String latest_description {channel=“feed:feed:c057385c:latest-description”}
DateTime latest_date {channel=“feed:feed:c057385c:latest-date”}
Number number_of_entries {channel=“feed:feed:c057385c:number-of-entries”}
String description {channel=“feed:feed:c057385c:description”}
String author {channel=“feed:feed:c057385c:author”}
DateTime published_date {channel=“feed:feed:c057385c:last-update”}
String title {channel=“feed:feed:c057385c:title”}

João

What feed are you pulling?

Hi

https://www.cmjornal.pt/rss?idCanal=9

João

Well, I don’t see anything in that feed currently that should have caused this problem.

However, I have nevertheless submitted a PR that should fix the problem if the feed ever fails to provide a date in the future…

@namraccr, glad you’re looking into this binding. It’s worked well for me, but I see these every OH restart…

2018-12-22 18:11:25.695 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: latest-date, no data has been downloaded from the server!
2018-12-22 18:11:25.696 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: latest-title, no data has been downloaded from the server!
2018-12-22 18:11:25.701 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: last-update, no data has been downloaded from the server!
2018-12-22 18:11:25.701 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: number-of-entries, no data has been downloaded from the server!
2018-12-22 18:11:25.696 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: description, no data has been downloaded from the server!
2018-12-22 18:11:25.696 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: author, no data has been downloaded from the server!
2018-12-22 18:11:25.697 [INFO ] [org.openhab.binding.feed.internal.handler.FeedHandler] - Can not update channel with ID: title, no data has been downloaded from the server!
2018-12-22 18:11:27.819 [ERROR] [org.eclipse.smarthome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: null
java.lang.NullPointerException: null
        at org.openhab.binding.feed.internal.handler.FeedHandler.publishChannelIfLinked(FeedHandler.java:129) ~[?:?]
        at org.openhab.binding.feed.internal.handler.FeedHandler.handleCommand(FeedHandler.java:273) ~[?:?]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:233) ~[?:?]
        at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:300) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
        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) [?:?]

And occasionally see these randomly…

2018-12-23 18:12:26.329 [WARN ] [org.eclipse.smarthome.core.internal.common.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
        at org.openhab.binding.feed.internal.handler.FeedHandler.publishChannelIfLinked(FeedHandler.java:129) ~[?:?]
        at org.openhab.binding.feed.internal.handler.FeedHandler.refreshFeedState(FeedHandler.java:113) ~[?:?]
        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) [?:?]

I have one Thing, all Channels linked, 60 minute refresh interval, reading from https://ci.eclipse.org/smarthome/job/SmartHomeDistribution-Stable/rssAll.

As far as I can tell, your feed has no description attributes in it, unlike the feed used by the OP.
The line where you’re getting the NPE is the line dealing with the description.

I’d also agree that the large blotto of INFO statements at startup is bad and should be avoided.

Would you raise an issue asking for these things to be fixed?

Here’s a jar that contains my planned fix if you’d like to test it out.

1 Like

Thank you… I hadn’t noticed the missing description! I’ll open an issue and remove that Item.