I'm running an enviroment with JSF + Primefaces + tomcat 6.0.32 in netbeans using EclipseLink (JPA 2.0).
My application works fine, but everytime I run it, I get a lot of warnings saying that cannot Serializate my session beans, and shows me blocks like this for every session bean:
18-jul-2012 23:05:46 org.apache.catalina.session.StandardSession writeObject
ADVERTENCIA: No puedo serializar atributo de sesión facturacionController para sesión 62A53325838E1E7C6EB6607B1E7965E6
java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
... and so on...
The thing is that my session beans already implements Serializable. So what can I do to solve this ?
Thanks !
---- added info 07/20/2012 ----
The only point where I'm making a reference to EntityManager from the session bean is when I create the jpaController in the getter property, like this:
private JpaController getJpaController() {
if (jpaController == null) {
jpaController = new JpaController(Persistence.createEntityManagerFactory("myPersistenceUnit"));
}
return jpaControllerPedido;
}
That is because I defined the jpaController constructor like this:
public JpaController(EntityManagerFactory emf) {
this.emf = emf;
}