"length must not be negative"

My app uses server pushes for UI refreshing and it has an scheduled TimerTask to display a clock. It simply updates a Label with the contents of a new generated Date() each second and properly formatted to my custom date / time format.

I had my app running all night in order to detect any potential problems / bugs, and this morning I found an “almost unnoticeable” exception in the form of a ! signal besides the caption of a little Grid I have for displaying data in the same screen (this Grid doesn’t get updated / refreshed by pushes, but just after some explicit user interaction, specifically after a button click). I wrote down the details in a paper because it was on a different computer, so I cannot reproduce the exact trace, but it had the following message:

“length must not be negative”

Other clases implied in the stack trace where (not restricted to):

RpcDataProvider
Tomcat.Util.Threads
ThreadPoolExecutor

Did a quick googling and the only reference I found was to this Vaadin Framework source file:


https://github.com/vaadin/framework/blob/master/shared/src/main/java/com/vaadin/shared/Range.java

Here you can see where the affected method (Range.withLength()) is used across the Framework:


https://github.com/vaadin/framework/search?utf8=✓&q=withLength(&type=

I have no idea what causes this nor how to / where to capture the exception (as it doesn’t seem to imply any practical consequences for the proper functioning of the app itself) in order to, at least, hide the message. Or how to treat it in case it must be done. Any hints?

UPDATE:--------------------------------------------------------------------------------------

In case anyone is interested, I’ve managed to get the full StackTrace:

Mar 22, 2017 7:31:36 AM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
java.lang.IllegalArgumentException: length must not be negative
at com.vaadin.shared.ui.grid.Range.withLength(Range.java:88)
at com.vaadin.server.communication.data.RpcDataProviderExtension.pushRowData(RpcDataProviderExtension.java:368)
at com.vaadin.server.communication.data.RpcDataProviderExtension.beforeClientResponse(RpcDataProviderExtension.java:334)
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:112)
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:168)
at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:149)
at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:240)
at com.vaadin.server.communication.PushHandler.onMessage(PushHandler.java:494)
at com.vaadin.server.communication.PushAtmosphereHandler.onMessage(PushAtmosphereHandler.java:87)
at com.vaadin.server.communication.PushAtmosphereHandler.onRequest(PushAtmosphereHandler.java:77)
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:199)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:107)
at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075)
at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:571)
at org.atmosphere.websocket.DefaultWebSocketProcessor$3.run(DefaultWebSocketProcessor.java:333)
at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101)
at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:328)
at org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:425)
at org.atmosphere.container.JSR356Endpoint$1.onMessage(JSR356Endpoint.java:214)
at org.atmosphere.container.JSR356Endpoint$1.onMessage(JSR356Endpoint.java:211)
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:399)
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:500)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:295)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:131)
at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:71)
at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1460)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

More updates: after leaving my app running for almost somewhat 20 hours, today I didn’t see any red !, but noted that the Grid component (the same that yesterday displayed the ! on its caption) today looked corrupted, with content of the 1st column of the 1st row cut and appearing at the last row, 1st or 2nd column, etc… Very strange. I don’t know if it’s related, though.