3 Replies Latest reply on Feb 10, 2010 12:09 AM by purecharger

    Authenticator component unreachable after failed login

    purecharger

      I used seamgen to create a skeleton project, using 2.2.1-SNAPSHOT from a couple weeks ago (to work with JBoss 6.0.0 M1). I created a custom Authenticator component class, and Seam finds it just fine:


      [org.jboss.seam.Component] (HDScanner) Component: Authenticator, scope: EVENT, type: JAVA_BEAN, class: com.everyonecounts.voting.auth.LoginManager
      



      I have it always returning true just to test with for now. So I navigate to my login page, /login.seam, and enter a username and no password, and this exception shows in the logs:


      ERROR [org.jboss.seam.exception.Exceptions] (http-127.0.0.1-8080-2) handled and logged exception
      javax.servlet.ServletException: viewId:/login.seam - View /login.seam could not be restored.
      



      Which is the first problem. Now however, when I navigate back to the login page and attempt another login, the component is no longer found:


      WARN  [org.jboss.seam.security.jaas.SeamLoginModule] (http-127.0.0.1-8080-2) Error invoking login method
      javax.el.PropertyNotFoundException: Target Unreachable, identifier 'authenticator' resolved to null
      



      I checked the scope of the Authenticator components in other Seam examples and they are also set to ScopeType.EVENT. I tried adding the @Stateless annotation to my Authenticator class, and that resulted in the component not being found at all during login (it was found at deployment time).


      So, any ideas?


      Thank you,
      Ryan

        • 1. Re: Authenticator component unreachable after failed login
          purecharger

          Talk about frustrating. Now half the time my Authenticator component isn't located by the EL parser:


          WARN  [org.jboss.seam.security.jaas.SeamLoginModule] (http-127.0.0.1-8080-1) Error invoking login method
          javax.el.PropertyNotFoundException: Target Unreachable, identifier 'authenticator' resolved to null
          



          Even though a few seconds earlier it was clearly loaded:


          [org.jboss.seam.Component] (HDScanner) Component: Authenticator, scope: EVENT, type: JAVA_BEAN, class: com.everyonecounts.voting.auth.LoginManager
          



          Very perplexing, and frustrating.

          • 2. Re: Authenticator component unreachable after failed login
            purecharger

            Ok, more information. I turned on TRACE level logging, and I still get log message that my Authenticator component is found, but when I actually login I get this:


            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.core.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.cache.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.transaction.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.framework.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.web.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.faces.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.international.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.theme.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.pageflow.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.bpm.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.jms.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.mail.authenticator
            2010-02-09 14:17:45,699 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.security.authenticator
            2010-02-09 14:17:45,700 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.security.management.authenticator
            2010-02-09 14:17:45,700 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.security.permission.authenticator
            2010-02-09 14:17:45,700 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.security.openid.authenticator
            2010-02-09 14:17:45,700 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.captcha.authenticator
            2010-02-09 14:17:45,700 TRACE [org.jboss.seam.Component] (http-127.0.0.1-8080-1) Seam component not found: org.jboss.seam.excel.exporter.authenticator
            



            So its searching for the authenticator component, which is already found on deployment, but then its looking in the jboss packages? I dont get it.


            Ryan

            • 3. Re: Authenticator component unreachable after failed login
              purecharger

              My first few problems have been solved. Turns out I had a case problem on the name 'authenticator'. Components.xml was looking for 'authenticator' and the @Name I gave my class was 'Authenticator'. I mistakenly assumed that seam slammed case on all names, not sure why I thought that.


              And then for the restoring view problem, I used this tip from a discussion on Nabble, adding to WEB-INF/web.xml:


              <context-param>
                      <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
                      <param-value>true</param-value>
              </context-param>
              



              I think I understand the general concept behind why this is, but it still seems very broken and kludgy to me.


              Hopefully these posts will help someone out. Too bad nobody responded throughout the day.


              Ryan