3 Replies Latest reply on Sep 13, 2011 4:35 PM by Hendy Irawan

    Seam Security 3.1.0.Beta2 not showing h:messages if login failed

    Hendy Irawan Newbie
      I'm having trouble with seam security 3.1.0.Beta2

      If login is failed, only exception is printed on JBossAS Console/log, however <h:messages/> does not output anything.

      Do I need to configure it ?

      I use JaasAuthenticator with the following config:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:s="urn:java:ee"
              xmlns:security="urn:java:org.jboss.seam.security"
              xmlns:jaas="urn:java:org.jboss.seam.security.jaas"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.jboss.org/schema/cdi/beans_1_0.xsd">

              <security:IdentityImpl>
                      <s:modifies/>
                      <security:authenticatorClass>org.jboss.seam.security.jaas.JaasAuthenticator</security:authenticatorClass>
              </security:IdentityImpl>
              <jaas:JaasAuthenticator>
                      <s:modifies/>
                      <jaas:jaasConfigName>other</jaas:jaasConfigName>
              </jaas:JaasAuthenticator>
             
              <interceptors>
              <!-- <class>org.jboss.seam.transaction.TransactionInterceptor</class> -->
              </interceptors>
             
      </beans>

      In JBoss I configure 'other' to use UsersRoles, and I also put users.properties and roles.properties in my project's src/main/resources.

      However, even if I put the right username/password, it gives this error:

      03:10:14,534 ERROR [org.jboss.seam.security.IdentityImpl] (http--127.0.0.1-8080-6) Login failed: org.jboss.seam.security.AuthenticationException: Authenticator must provide a non-null User after successful authentication
              at org.jboss.seam.security.IdentityImpl.postAuthenticate(IdentityImpl.java:281) [seam-security-3.1.0.Beta2.jar:]
              at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:233) [seam-security-3.1.0.Beta2.jar:]
              at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:164) [seam-security-3.1.0.Beta2.jar:]
              at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java) [seam-security-3.1.0.Beta2.jar:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_22]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_22]
              at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_22]
              at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
              at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
              at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
              at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.0.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2054) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]

      Any advice would be appreciated, please help.