I have a created a EJB3 Project with a session EJB facade for entity EJB's. I created a client that looks up the session EJB and tries to get entities serialized back. When I have entities with lazy loaded entities, I get a MarshalException delivered in an UndeclaredThrowableException. The details are :
org.hibernate.HibernateException: CGLIB Enhancement failed : com.test.Test
where Test is a lazily loaded entity.
* Should I be able to get the entities from the session bean?
* Is there a better way of accomplishing this?
I do not want to be forced to load all that information eagerly.
You must initialize all lazy property (in session bean facade) before returning them to client side !
just do : myObject.getMyCollection().size() => initialize this property.
Good luck