session-bean

Can't Serialize Session Beans - Warning thrown

◇◆丶佛笑我妖孽 提交于 2019-12-02 08:59:59
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

IllegalStateException when trying to .getSessionMap() from a Session Scoped Bean

主宰稳场 提交于 2019-12-01 13:27:48
I'm new to Java and JSF. I need help with an IllegalStateException. Here's the scenario: In my current project i have this Session Scoped bean for the application menu: public final class MenuBean implements Serializable{ private MenuModel model; private FacesContext context = FacesContext.getCurrentInstance(); public MenuModel getModel() { return model; } public MenuBean() { updateMenu(); } public void updateMenu(){ Map session = (Map<String,Object>) context.getExternalContext().getSessionMap(); EUser user = (EUser) session.get(UserBean.USER_SESSION_KEY); ... } private MethodExpression

IllegalStateException when trying to .getSessionMap() from a Session Scoped Bean

别等时光非礼了梦想. 提交于 2019-12-01 09:58:55
问题 I'm new to Java and JSF. I need help with an IllegalStateException. Here's the scenario: In my current project i have this Session Scoped bean for the application menu: public final class MenuBean implements Serializable{ private MenuModel model; private FacesContext context = FacesContext.getCurrentInstance(); public MenuModel getModel() { return model; } public MenuBean() { updateMenu(); } public void updateMenu(){ Map session = (Map<String,Object>) context.getExternalContext()

EJB 3 Session Bean Design for Simple CRUD

杀马特。学长 韩版系。学妹 提交于 2019-11-30 04:24:31
I am writing an application that's sole purpose in life is to do CRUD operations for maintaining records in database. There are relationships between some of the tables/entities. Most examples I've seen for creating session beans deals with complex business logic/operations that interact with many entities which I don't have. Since my application is so very basic, what would be the best design for the session bean(s)? I was thinking of having one session bean per entity which had CRUD the methods defined. Then I thought of combining all of those session beans into a single session bean. And