2 Replies Latest reply on Nov 15, 2005 7:06 AM by Antonio Mota

    Problem with session bean on JSF

    Antonio Mota Newbie

      Hello, i'm new in here, so new i'm not even sure i'm on the right forum.

      I've developed a app prototype that stores some form data on a very simple POJO session bean, that is retrieved on another page. It's working on my develop machine, using IBM Rational App Dev (Eclipse) and Websphere 6.0.

      But when i deploy the war file on the production machine (JBoss4.0.2/Tomcat5.5.9) the session bean doesn´t work. It acts as it has some kind of "page" scope, and not session scope as defined on faces-config.xml.

      Is there some thing specific to JBoss implementation?

      Thanks for you help.

      P.S. I tryed to instal JBoss on my dev machine but the war never gets deployed, it gives a series of erros on deployement.



        • 1. Re: Problem with session bean on JSF
          Antonio Mota Newbie

          Here's some more info: In faces-context.xml i have

          <managed-bean>
          <managed-bean-name>ordens</managed-bean-name>
          <managed-bean-class>pt.md.transe.OrdensBean</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
          </managed-bean>

          I create the bean with various ways:

          ordens = (OrdensBean) getFacesContext().getApplication() .createValueBinding("#{ordens}").getValue(getFacesContext());

          FacesContext.getCurrentInstance()..getApplication()
          .createValueBinding("#{ordens}")
          .getValue(FacesContext.getCurrentInstance());

          OrdensBean ordens = (OrdensBean)this.getFacesContext()
          .getApplication()
          .getVariableResolver()
          .resolveVariable(this.getFacesContext(), "ordens");

          and i'm retrieving the bean in the second page like this:

          OrdensBean bean = (OrdensBean)sessionScope.get("ordens");

          OrdensBean bean = (OrdensBean) FacesContext
          .getCurrentInstance()
          .getApplication()
          .createValueBinding("#{ordens}")
          .getValue(FacesContext.getCurrentInstance());

          FacesContext context = FacesContext.getCurrentInstance();
          Map sessionMap = context.getExternalContext().getSessionMap();
          OrdensBean bean = (OrdensBean) sessionMap.get("ordens");

          All of then work in my dev machine, using RAD/Websphere. None of then works in the production machine, JBoss.

          I don't know what to do next, please help.

          Thanks.

          • 2. Re: Problem with session bean on JSF
            Antonio Mota Newbie

            I'm getting desesperated here... Now it goes like this:

            I've instaled JBoss 4.0.3 both on my local dev machine and on the production machine, and aftyer some initial problems i deployed my war file on both machines.

            It's working on my machine BUT NOT on th eproduction machine.

            The only diferences i can see is that one (dev) is a Windows2000 and the other is Linux...

            Can someone PLEASE PLEASE give me any advice, or at least some pointer where to look, before i0ll go insane? PLEASE!

            Thanks a lot.