NullPointerException @ DatabaseServerLoginModule.java:141, J
jahebe Jan 21, 2008 3:51 PMHello, all.
I'm having some problems with the DatabaseServerLoginModule and would appreciate any help, as the logged error messages do not tell me much:
DataSource
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE datasources PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd"> <datasources> <local-tx-datasource> <jndi-name>FluxMonClockerDS</jndi-name> <!-- <use-java-context>false</use-java-context>--> <connection-url> jdbc:postgresql://localhost:5432/fluxmon </connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>fluxmon</user-name> <password>fluxmon</password> <metadata> <type-mapping>PostgreSQL 8.0</type-mapping> </metadata> </local-tx-datasource> </datasources>
Database content/result of queries
fluxmon=> SELECT PASSWORD FROM CLOCKER_USERS WHERE PHONENUMBER='+4797516690'; password ------------------------------ 7EDGLd8tLX01PmrX0eNSm7aGfg8= (1 rad) fluxmon=> SELECT Role, 'Roles' FROM CLOCKER_USERS WHERE PHONENUMBER='+4797516690'; role | ?column? ------+---------- user | Roles (1 rad) fluxmon=>
Exception:
2008-01-21 21:22:51,663 TRACE [org.jboss.security.plugins.JaasSecurityManager] Constructing 2008-01-21 21:22:51,664 DEBUG [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] CallbackHandler: org.jboss.security.auth.callback.SecurityAssociationHandler@10bfedd 2008-01-21 21:22:51,664 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@896e10 2008-01-21 21:22:51,665 DEBUG [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] CachePolicy set to: org.jboss.util.TimedCachePolicy@991d56 2008-01-21 21:22:51,665 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@991d56 2008-01-21 21:22:51,665 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added fluxmonClocker, org.jboss.security.plugins.SecurityDomainContext@5532da to map 2008-01-21 21:22:51,665 TRACE [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] Begin isValid, principal:+4797516690, cache info: null 2008-01-21 21:22:51,665 TRACE [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] defaultLogin, principal=+4797516690 2008-01-21 21:22:51,666 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(fluxmonClocker), size=8 2008-01-21 21:22:51,666 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(fluxmonClocker), authInfo=AppConfigurationEntry[]: [0] LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule ControlFlag: LoginModuleControlFlag: required Options:name=principalsQuery, value=SELECT PASSWORD FROM CLOCKER_USERS WHERE PHONENUMBER=? name=unauthenticatedIdentity, value=guest name=dsJndiName, value=java:/FluxMonClockerDS name=rolesQuery, value=SELECT ROLE, 'Roles' FROM CLOCKER_USERS WHERE PHONENUMBER=? 2008-01-21 21:22:51,672 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize, instance=@19690316 2008-01-21 21:22:51,672 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Security domain: fluxmonClocker 2008-01-21 21:22:51,678 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Saw unauthenticatedIdentity=guest 2008-01-21 21:22:51,679 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=java:/FluxMonClockerDS 2008-01-21 21:22:51,679 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT PASSWORD FROM CLOCKER_USERS WHERE PHONENUMBER=? 2008-01-21 21:22:51,679 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT ROLE, 'Roles' FROM CLOCKER_USERS WHERE PHONENUMBER=? 2008-01-21 21:22:51,679 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendResume=true 2008-01-21 21:22:51,679 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login 2008-01-21 21:22:51,681 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendAnyTransaction 2008-01-21 21:22:51,683 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] resumeAnyTransaction 2008-01-21 21:22:51,685 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort 2008-01-21 21:22:51,685 TRACE [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] Login failure javax.security.auth.login.LoginException: java.lang.NullPointerException at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:141) at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) at javax.security.auth.login.LoginContext.login(LoginContext.java:579) at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:603) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:537) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Thread.java:619) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:872) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) at javax.security.auth.login.LoginContext.login(LoginContext.java:579) at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:603) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:537) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Thread.java:619) 2008-01-21 21:22:51,685 TRACE [org.jboss.security.plugins.JaasSecurityManager.fluxmonClocker] End isValid, false 2008-01-21 21:22:51,685 TRACE [org.jboss.security.SecurityAssociation] clear, server=true