I'm developing an application using GXT and Hibernate. Here is the code, this is an "EJB site" method:
Query query = em.createNamedQuery("PrinterSite.findByIdandSite");
query.setParameter("abc", printer);
query.setParameter("def", site);
List<PrinterSite> printerSite = query.getResultList();
List<Printer> stm = new ArrayList<Printer>();
for(PrinterSite ps: printerSite) {
stm.add(ps.getPrinter());
}
return stm;
The List<Printer> stm
object is correctly filled. The problem come when the object is returned to the "GWT site". I got this exception:
...
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:106)
at org.hibernate.proxy.pojo.javassist.SerializableProxy.readResolve(SerializableProxy.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
I can't figure out what's going wrong with my code. Why I can't pass correctly the List
to the application's "GWT site"? Why java.lang.NoClassDefFoundError
? I use Maven and the jar is in the classpath. TIA.
Francesco