now for the second time I encountered an rather mysterious exception:
java.lang.NumberFormatException: For input string: "-0.7142857142857189"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:458)
at java.lang.Integer.valueOf(Integer.java:554)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.convertVariableValue(AbstractCommunicationManager.java:1233)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1034)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:561)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:260)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:438)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Obviously there is an integer expected and not a double.
Because I could not repeat this by intention I don’t know which component causes this.
Is there a simple way to catch the problems source or do I have to extend the Vaadin code?
How do you get into this error? Do you have some own component? Client side has coded the variable to be of type int, but has still put a float value there.
You could use hosted mode and vaadin client side debug dialog to track down the faulty component.
As I wrote, the error occured out of nowhere and I don’t remember which component I clicked.
So far I’m not able to reproduce it, therefore the debug-mode is not really helping.
I can only hope to trip over it again - with a more informative logging.
Edit:
Now I could reproduce the exception. The owner in the actual case is a table and the variable to change is:
That’s odd. I check the code on the Table components client side counterpart and it sends int type variable. This starts to look like a pretty critical GWT bug. What browser are you using and what is the exact Vaadin version?
I’m using the 6.2 svn trunk of Vaadin as I incorporate some changes. (But the table classes are not affected.)
So after watching the error a bit I think, it’s an javascript error in Opera 10.50.
Table sends an update pagelength to the server after it has been rendered provided it has fixed height (pixels or %). The event is not immediate so it will be sent when anything else causes a server visit. I would recommend you try to reproduce the error with a Vaadin 6.2 nightly to rule out any customizations.
If you can reproduce it you can probably make quite a reduced test case of it which shows the problem. I tried to do this but the simples possible case with a fixed height Table does not show this behavior (pagelength is sent as an integer, just like it should).
It sure seems like an Opera 10.50 or GWT bug. The code in VScrollTable is
int bodyH = bodyContainer.getOffsetHeight();
int rowsAtOnce = bodyH / rowHeight;
When bodyH is 255 and rowHeight 21, rowsAtOnce becomes 12.14 and not 12 i.e., it is not truncated as it should. The best thing to do would be to find out if it is an Opera or GWT problem and file an issue to one of their tracs. You could also create a ticket in the
Vaadin trac and somebody might figure out a workaround for it.