com.vaadin.data.util.MethodProperty$MethodException when using beanContaine

Hi All,

i use Vaadin 7.1.0.

I show my Person entities in table with BeanItemContainer. For the purpose of showing nested property Location in table i added beanContainer.addNestedContainerProperty(“location.name”). But i started to get errors. Any idea?

Exceptions i get…

Caused by: com.vaadin.ui.Table$CacheUpdateException: Error during Table cache update. Additional causes not shown.
at com.vaadin.ui.Table.maybeThrowCacheUpdateExceptions(Table.java:1690)
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1679)
at com.vaadin.ui.Table.refreshRowCache(Table.java:2613)
at com.vaadin.ui.Table.containerItemSetChange(Table.java:4402)
at com.vaadin.data.util.AbstractContainer.fireItemSetChange(AbstractContainer.java:242)
at com.vaadin.data.util.AbstractContainer.fireItemSetChange(AbstractContainer.java:228)
at com.vaadin.data.util.AbstractBeanContainer.addAll(AbstractBeanContainer.java:704)
at com.vaadin.data.util.BeanItemContainer.addAll(BeanItemContainer.java:176)

Caused by: com.vaadin.data.util.MethodProperty$MethodException
at com.vaadin.data.util.NestedMethodProperty.getValue(NestedMethodProperty.java:205)
at com.vaadin.ui.Table.formatPropertyValue(Table.java:4012)
at com.vaadin.ui.Table.getPropertyValue(Table.java:3956)
at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2308)
at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2147)
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1668)
… 47 more
Caused by: java.lang.NullPointerException
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.vaadin.data.util.NestedMethodProperty.getValue(NestedMethodProperty.java:201)
… 52 more

Probably your location is null. As indicated in the javadoc for nested properties, the current version of NestedMethodProperty does not support that.

There is a patch (currently in code review for Vaadin 7.2,
#11435
) that would add support for null intermediate property values of nested properties.

I realized that it occurs when location property of person is null. But my beans have null nested beans. Is there a way for null properties? For example if my description is “person.location.name” and location is null, it returns null, etc…

I need that patch. When can we have it as mavenized?