1 Reply Latest reply: Jul 5, 2011 7:46 PM by Bruno Vernay RSS

Load module error reported at TRACE level

Bruno Vernay Newbie

Hi,

I used to test different login modules in standalone.xml and inadvertently I made a typo in the code attribute.

<subsystem xmlns="urn:jboss:domain:security:1.0">
            <security-domains>              
                <security-domain name="mypolicy" cache-type="default">
                    <authentication>
                        <login-module code="database" flag="required">
                            <module-option name="dsJndiName" value="java:jboss/datasources/ExampleDS"/>
                            <module-option name="principalsQuery" value="SELECT Password FROM User WHERE Username=?"/>
                            <module-option name="rolesQuery" value="SELECT Role, 'Roles' FROM User WHERE Username=?"/>
                        </login-module>
                    </authentication>
                </security-domain>
            </security-domains>
        </subsystem>

 

I could not login obviously. But to find the problem I had to set the log at TRACE level:

22:28:05,143 TRACE [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http--127.0.0.1-8080-1) Login failure: javax.security.auth.login.LoginException: unable to find LoginModule class: database from [Module "deployment.jboss-as-login.war:main" from Service Module Loader]
          at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808) [:1.6.0_24]
          at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [:1.6.0_24]
          at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [:1.6.0_24]
          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_24]
          at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) [:1.6.0_24]
          at javax.security.auth.login.LoginContext.login(LoginContext.java:579) [:1.6.0_24]
          at org.jboss.security.authentication.JBossCachedAuthenticationManager.defaultLogin(JBossCachedAuthenticationManager.java:411) [picketbox-infinispan-4.0.0.CR1.jar:4.0.0.CR1]
          at org.jboss.security.authentication.JBossCachedAuthenticationManager.authenticate(JBossCachedAuthenticationManager.java:345) [picketbox-infinispan-4.0.0.CR1.jar:4.0.0.CR1]
          at org.jboss.security.authentication.JBossCachedAuthenticationManager.isValid(JBossCachedAuthenticationManager.java:154) [picketbox-infinispan-4.0.0.CR1.jar:4.0.0.CR1]
          at org.jboss.as.web.security.JBossWebRealm.authenticate(JBossWebRealm.java:127) [jboss-as-web-7.0.0.CR1.jar:7.0.0.CR1]
          at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.CR1.jar:7.0.0.CR1]
          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.CR1.jar:7.0.0.CR1]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]


22:28:05,157 TRACE [org.jboss.modules] (http--127.0.0.1-8080-1) Finding class org.jboss.security.authentication.SubjectActions$SetContextInfoAction from Module "org.picketbox:main" from local module loader @341960 (roots: /opt/jboss7/jboss-7.0.0.CR1/modules)
...
22:28:05,168 TRACE [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/jboss-as-login]] (http--127.0.0.1-8080-1) Username demo NOT successfully authenticated
22:28:05,170 DEBUG [org.apache.catalina.authenticator.AuthenticatorBase] (http--127.0.0.1-8080-1)  Failed authenticate() test
...

 

Otherwise at DEBUG level, I only get the "Failed authenticate() test", the same message that I get with a wrong password for example.

 

Shall fill a bug to request that the "unable to find LoginModule class" error for the "required" module is logged at WARNING level at least ??