0 Replies Latest reply on Jul 26, 2007 11:41 AM by Thiagu Mariappan

    Login function with  modal panel  not proper in seam 2.0.0 B

    Thiagu Mariappan Novice

      i am use the modal panel component for login function. It works properly in seam 1.2.1 GA but it gives some problem in seam 2.0.0 BETA1.

      1.if i use JSF command button for login it woke properly once, Second time i try to login it not allowed me to login, and also not give any authentication error, and Exception. But in my
      Jboss 4.2.0.GA console shows this two lines

      20:31:59,359 INFO [Contexts] starting up: org.jboss.seam.security.ide
      20:31:59,359 INFO [Contexts] starting up: org.jboss.seam.web.session

      2. if i use ajax4jsf command button for login, because i try to show the validation error message on my login modal panel it woke properly once, Second time i try to login it not allowed me to login, i get ?View could not be restored ? reload page? alert on my browser and also i get this Exception on my Jboss 4.2.0.GA console

      20:48:38,812 ERROR [ExceptionFilter] handling uncaught exception
       javax.servlet.ServletException: Stack must not be null
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
       icationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
       ilterChain.java:206)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
       .java:83)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.jav
       a:63)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
       .java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
       .java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
       .java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
       .java:69)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseX
       MLFilter.java:127)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.
      
      
      
      ---------------------------------and -------------------------------
      
      20:48:38,812 ERROR [ExceptionFilter] exception root cause
      java.lang.IllegalArgumentException: Stack must not be null
       at org.jboss.seam.core.ConversationEntry.<init>(ConversationEntry.java:3
      9)
       at org.jboss.seam.core.ConversationEntries.createConversationEntry(Conve
      rsationEntries.java:53)
       at org.jboss.seam.core.Manager.createConversationEntry(Manager.java:510)
      
       at org.jboss.seam.core.Manager.beforeRedirect(Manager.java:651)
       at org.jboss.seam.faces.FacesManager.beforeRedirect(FacesManager.java:63
      )
       at org.jboss.seam.faces.FacesManager.appendConversationIdFromRedirectFil
      ter(FacesManager.java:222)
       at org.jboss.seam.web.RedirectFilter$1.sendRedirect(RedirectFilter.java:
      65)
       at com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImp
      l.java:419)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandl
      er.java:180)
       at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:9
      3)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.ja
      va:316)
       at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrap
      per.java:116)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandl
      
      
      
      


      this my view part

      
      <a href="javascript:Richfaces.showModalPanel('mp',{width:450, top:200})">Login</a>
      
      <rich:modalPanel id="mp" minHeight="200" minWidth="450"
       height="300" width="500" zindex="2000">
       <h:form>
      
       <h:outputLabel for="username">Username</h:outputLabel>
       <h:inputText id="username"
       value="#{identity.username}"/>
       <h:outputLabel for="password">Password</h:outputLabel>
       <h:inputSecret id="password"
       value="#{identity.password}"/>
      
       <a:commandButton value="Login" action="#{identity.login}"/>
      
      
       </h:form>
      
      
      </rich:modalPanel>


      and my session bean is

      @Stateful
      @Scope(SESSION)
      @Name("authenticator")
      public class AuthenticatorAction implements Authenticator
      {
       @PersistenceContext EntityManager em;
      
       @In(required=false, scope = SESSION)
       private Tbluser user;
      
       @In
       private FacesMessages facesMessages;
      
       public boolean authenticate()
       {
       List results = em.createQuery("select u from Tbluser u where u.siId=#{identity.username} and u.password=#{identity.password}")
       .getResultList();
      
       if ( results.size()==0 )
       {
      
       facesMessages.addToControl("password", "Invalid Username or Password");
       return false;
       }
       else
       {
      
       user = (TblProfiles) results.get(0);
       return true;
       }
      
       }
       @Destroy @Remove
       public void destroy() {}
      
      }
      


      Any one give me the solution

      By
      Thiagu.M