Mysterious error


now for the second time I encountered an rather mysterious exception:

java.lang.NumberFormatException: For input string: "-0.7142857142857189"
 	at java.lang.NumberFormatException.forInputString(
	at java.lang.Integer.parseInt(
	at java.lang.Integer.valueOf(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.convertVariableValue(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
	at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
	at javax.servlet.http.HttpServlet.service(

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.

Now I could reproduce the exception. The owner in the actual case is a table and the variable to change is:

VAR_VALUE = 17.800000000000004
VAR_NAME = pagelength

I will investigate further and report what I find out.


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).


I was able to reproduce the error constantly with following steps:

  1. Open the application in Opera
  2. Decrease the window size with mouse
  3. Click on the other tab
  4. Error message appears


  • Windows XP SP 3
  • Java 1.6.0_18
  • Vaadin 6.2.6
  • JBoss 5.1.0GA, default
  • Opera 10.50

Application code

import com.vaadin.Application;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.Window;

public class Vaadin_testApplication extends Application 
  private static final long serialVersionUID = 1L;

  public void init() 
    Window mainWindow = new Window("Vaadin_test Application");
    Window window=new Window();
    window.setWidth(40, Window.UNITS_PERCENTAGE);

    TabSheet tab=new TabSheet();

    tab.addTab(new TableView(),"users",null);
    tab.addTab(new TableView(),"groups",null);

  public class TableView extends Table 
    private static final long serialVersionUID = 1L;
    public TableView()



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">
  	Vaadin production mode</description>
  	<servlet-name>Vaadin_test Application</servlet-name>
  		Vaadin application class to start</description>
  	<servlet-name>Vaadin_test Application</servlet-name>

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.

The workaround (at least for this case) is simple:

int rowsAtOnce = Math.round(bodyH / rowHeight);

But I agree that there might be a fundamental problem with GWT and/or Opera 10.50.

to track this issue. Math.round is not a proper solution as Math.round(10.51) returns 11 and not 10 like it should in this case.

This Opera bug (CARAKAN-1263) has been fixed in the latest Opera snapshot and so the problem will be resolved with Opera 10.54.