Problem "Cannot format given Object as a Number" adding Items to an IndexCo

Hi, I got a problem adding Items to an IndexContainer bounded to a Table.

Debugging I saw that the line that raise the exception is the StringToLongConverter class when it tries to convert using the locale.

Of course I tried to change my locale but the problem still occurs.

Is there anyone that have experienced the same problem or have a solution?

Those are the portion of code that produce the exception…

kind regards


value = getPropertyValue(id, colids[j]
, p);
} catch (Exception e) {
value = null;



protected NumberFormat getFormat(Locale locale) {
if (locale == null) {
locale = Locale.getDefault();
return NumberFormat.getIntegerInstance(locale);

this is the same error generated where the framework tried to refresh the table…

Caused by: java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.text.DecimalFormat.format(
at java.text.Format.format(
at com.vaadin.ui.Table.formatPropertyValue(
at com.vaadin.ui.Table.getPropertyValue(
at com.vaadin.ui.Table.parseItemIdToCells(
at com.vaadin.ui.Table.getVisibleCellsNoCache(
at com.vaadin.ui.Table.refreshRenderedCells(

The problem is that the framework tries to convert una empty string (“”) to a number…
anyone knows how to avoid that ? Can I disable Cache population?

I temporarly solved getting the Item after the exception with the ItemId I’ve used
to add the item to the container…

try {
item = container.addItem(element.getId());
} catch (Exception ex) {
item = container.getItem(element.getId());

but it’s only a work around :frowning: