Tree with JPAContainer

Hello guys,

I have a problem to use the JPAContainer with tree.
after setting the data source and the tree:

jpaContainer.setParentProperty("parent");
tree = new Tree(null, jpaContainer);
tree.setImmediate(true);
tree.setSizeFull();
tree.setItemCaptionMode(ItemCaptionMode.PROPERTY);
tree.setItemCaptionPropertyId("description");

I try to add one entity:

jpaContainer.addEntity(entity);

This action triggers the following error:

Caused by: java.lang.AbstractMethodError: com.vaadin.addon.jpacontainer.JPAContainer.getContainerFilters()Ljava/util/Collection;
    at com.vaadin.ui.Tree.containerItemSetChange(Tree.java:942)

The line of code that throws the error (belonging to Tree.containerItemSetChange method) is the following:

boolean hasFilters = !((Filterable) getContainerDataSource())
                    .getContainerFilters().isEmpty();

JPAContainer does not have the getContainerFilters() method, instead have the getFilters() method.

i’m using vaadin 7.1.7

it’s a bug ? or is my error ??

Thank you in advance :slight_smile:

Fixed!

When you use the maven command to build a new project with the latest version of vaadin (7.1.7 for example) you have in the pom the dependency: <dependency> <groupId>com.vaadin.addon</groupId> <artifactId>jpacontainer-addon</artifactId> <version>LATEST</version> </dependency>

This dependency downloads the jpaContainer 3.0.0-SNAPSHOT incompatible with vaadin 7.1.x.
We need to replace the dependency with this: <dependency> <groupId>com.vaadin.addon</groupId> <artifactId>jpacontainer</artifactId> <version>3.1.0</version> </dependency>