LazyEntityContainer initialization problems

I have some Exceptions where I use LazyEntityContainer :
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at org.vaadin.addons.lazyquerycontainer.EntityQuery.(
at org.vaadin.addons.lazyquerycontainer.EntityQueryFactory.constructQuery(
at org.vaadin.addons.lazyquerycontainer.LazyQueryView.getQuery(
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.vaadin.event.ListenerMethod.receiveEvent(

Here is some parts of my code :
private LazyEntityContainer containerBouteille;

containerBouteille = new LazyEntityContainer(em, Bouteille.class, 2, “id”, false, false, false);
tableBouteille = new Table(“My Table Binded”, containerBouteille);

Bouteille b = containerBouteille.addEntity();


So I need some help.

Can someone give me some example of how to use it or a link to page where it is shown, please ?


Apparently that addon needs the log4j library on the classpath. Just add it to your classpath and you should be good to go.

Thanks you Thomas, It works better.

Now, I try to check if an entity is already in the LazyEntityContainer before persisting it.
I want to avoid JPQL queries if it’s possible.
The method LEC.containsId() requires the ID so I can’t use it before the persistence.
Is there a way to do that like the List.contains(Object) method does ?


I have another question : when I persist an entity (em.persist()), to update my table, do I have to commit the LEC or refresh it ?


Haven’t used the LQC myself, so unfortunately I have no clue :slight_smile: Hopefully someone else can help.