NPE warnings in ServletHandler #4521
Comments
I haven't seen this myself. The root cause is clearly a bug in the XChart library, so you might want to follow up on that project to see how it can be fixed. |
Thanks, I will do that. One questions in advance: Which version of the XChart library do we use? Maybe there is a newer release version available which already has a fix for this in it. |
We are using xchart 2.6.1 as it seems. |
Okay, I think I will not open an issue in the XChart project. This version is kind of outdated. |
The NPEs disappeared. Now I am getting warnings with Using openHAB 2.2.0 Build #1078 with charts in BasicUI.
|
@cweitkamp It would be great if you could post a demo configuration that could be used to reproduce that error. Then we just need to drop that configuration in the respective directories and use the Eclipse Runtime launch configuration to identify the root cause. |
@maggu2810 I'm not sure which configurations you mean exactly. What do you need: rr4dj.cfg, all related items and groups, the sitemap? Anything else? Here is a link to the community thread where other people talk about these warnings too. https://community.openhab.org/t/io-error-with-png-files-after-update-to-oh2-2-i-o-error-writing-png-file/37724/14 You would make me happy if we can reopen this issue and da some more investigations. Thank you. |
@maggu2810 I guess I've found a way how to reproduce these IIOExceptions. My sitemap files look like this (it's only an abstract): sitemap fritz label="AVM FRITZ!Box 7490" {
Frame label="FRITZ!DECT 200 #1" {
Text item=fritzDECT200Power {
Frame label="Stromverbrauch" {
Switch item=fritzChartPeriod mappings=[0="Stunde", 1="4 Stunden", 2="Tag", 3="Woche"]
Chart item=fritzDECT200Power refresh=5000 period=h visibility=[fritzChartPeriod==0]
Chart item=fritzDECT200Power refresh=5000 period=4h visibility=[fritzChartPeriod==1]
Chart item=fritzDECT200Power refresh=5000 period=D visibility=[fritzChartPeriod==2, fritzChartPeriod==NULL]
Chart item=fritzDECT200Power refresh=5000 period=W visibility=[fritzChartPeriod==3]
}
}
}
} Navigate to the sitemap which contains the multiple charts, only one of them is visible. If you now change the visibility of one chart by clicking on the related |
What I have think about has been: |
Hi, I'm not sure if the issue from above shall be solved completely, but I still have a lot of those exceptions in my log file. I work with openHAB 2.3.0 Build #1225 on openhabian using rrd4j. If somebody needs some more details I would be happy to support, but I'm new and mostly understand only "Böhmische Dörfer" :-), so I would need some details how to provide what ... |
FTR #5442 solves this issue. |
When a charts (or charts) on a sitemap are refreshed in the Android app and then directly a refresh is triggered again it generates the following error: ``` 2018-12-10 09:56:02.654 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /chart javax.servlet.ServletException: java.io.EOFException at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:88) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.Server.handle(Server.java:531) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680) [87:org.eclipse.jetty.util:9.4.11.v20180605] at java.lang.Thread.run(Thread.java:748) [?:?] Caused by: java.io.EOFException at java.io.RandomAccessFile.readFully(RandomAccessFile.java:438) ~[?:?] at javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:254) ~[?:?] at javax.imageio.stream.ImageInputStreamImpl.flush(ImageInputStreamImpl.java:825) ~[?:?] at javax.imageio.ImageIO.doWrite(ImageIO.java:1615) ~[?:?] at javax.imageio.ImageIO.write(ImageIO.java:1492) ~[?:?] at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:336) ~[?:?] 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/chart:865) ~[?:?] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[?:?] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[?:?] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[?:?] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[?:?] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) ~[?:?] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[?:?] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?] ... 15 more Suppressed: java.lang.IndexOutOfBoundsException at javax.imageio.stream.FileCacheImageOutputStream.seek(FileCacheImageOutputStream.java:170) ~[?:?] at javax.imageio.stream.FileCacheImageOutputStream.close(FileCacheImageOutputStream.java:231) ~[?:?] at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:338) ~[?:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[29:javax.servlet-api:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[29:javax.servlet-api:3.1.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) ~[?:?] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) ~[?:?] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.Server.handle(Server.java:531) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680) [87:org.eclipse.jetty.util:9.4.11.v20180605] at java.lang.Thread.run(Thread.java:748) [?:?] ``` I suspect the output stream is closed during creating of the image because the new refresh aborts the previous one. Therefor I don't think this should result in such a log message. A similar problem was handled with `IIOException` see issue #4521 (solved in pr #5442). This change suggest to handle the `EOFException` the same as the `IIOException`. Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Every once and a while I get some of these NPE warnings. Does anybody else see such warnings? Can we lower the log level of those or handle them in any way?
Using openHAB 2.2.0 Build #1065 with rrd4j persistence and charts in BasicUI.
The text was updated successfully, but these errors were encountered: