OH3 chart: NullPointerException when accessing http://openhabserver:port/chart

,

OH3 throws a NullPointerException when “/chart” is accessed at http://openhabserver:port/chart.

E.g.
http://openhabserver:port/chart?items=MyItem

The problem is not related to any item or other parameters. Also omitting all parameters causes a NullPointerException:
http://openhabserver:port/chart

HTTP ERROR 500
Problem accessing /chart. Reason:

    Server Error
Caused by:
java.lang.NullPointerException
	at java.base/java.util.ImmutableCollections$MapN.probe(ImmutableCollections.java:956)
	at java.base/java.util.ImmutableCollections$MapN.get(ImmutableCollections.java:876)
	at org.openhab.core.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:228)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:494)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
	at java.base/java.lang.Thread.run(Thread.java:834)
  • Platform information:
    • Hardware: Raspberry Pi 4 8 GB
    • OS: openHABianPi 5.4.79-v7l+
    • Java Runtime Environment: openjdk version “11.0.9”
    • openHAB version: 3.0.0, upgraded from OH 2.5

Should I file a bug report?

Thanks for your advice!
Gert

Yes, please file a bug report for this. The code looks like it needs a little more safety. In the meantime you could try to amend the period parameter (or begin and end) to your request.

http://openhabserver:port/chart?items=MyItem&period=D

Yes, please file a bug report for this.

Will do so.

In the meantime you could try to amend the period parameter (or begin and end) to your request.

http://openhabserver:port/chart?items=MyItem&period=D

I confirm, this solves the problem :slight_smile:

Thank you a lot!
Gert

Good to hear. I nonetheless submitted a minor patch for the reported issue. Thanks.

Fantastic!

Thank you for your immediate response and fix for the problem!

… then there is no more need for me to write a bug report.

Best regards,
Gert