Hi,
I'm using TomEE 7.0.3 WebProfile (thus latest OpenWebBeans) with Hibernate
5.2.9. I'm trying to write CDI producer for ViewScoped EntityManager:
@PersistenceUnit
private EntityManagerFactory emf;
@Produces
@ViewScoped
private EntityManager createJTAViewScopedEntityManager() {
return emf.createEntityManager(SynchronizationType.SYNCHRONIZED));
}
Yet at the injection point I'm getting exception:
javax.el.ELException: javax.enterprise.inject.IllegalProductException:
WebBeans producer : createJTAViewScopedEntityManager return type in the
component implementation class : lt.vu.usecases.cdi.JPAResources with
passivating scope @javax.faces.view.ViewScoped must be Serializable
I don't understand the reason for this exception, because Hibernate returns
instance of class "SessionImpl" (as can be seen with debugger), and this
class *implements Serializable*. What is the problem?
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/IllegalProductException-return-type-must-be-Serializable-for-Hibernate-SessionImpl-tp4681517.html
Sent from the TomEE Dev mailing list archive at Nabble.com.