javax.security.auth.login.LoginException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • As written in reference documentation I tried to use an application-policy like this: <application-policy name = "core"> <authentication> <!-- reference doc says JbossSpringLoginModule but this was renamed in cvs --> <login-module code = "net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule" flag = "required"> <module-option name = "singletonId">springRealm</module-option> <module-option name = "key">my_password</module-option> <module-option name = "authenticationManager">authenticationManager</module-option> </login-module> </authentication> </application-policy> I got NullPointerException, here is the log: 2005-09-26 17:25:42,433 INFO [net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule] initializing jboss login module 2005-09-26 17:25:42,434 TRACE [org.jboss.security.plugins.JaasSecurityManager.core] Login failure javax.security.auth.login.LoginException: java.lang.NullPointerException at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(ConcurrentReaderHashMap.java:298) at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:410) at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:197) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromClassLoader(UnifiedLoaderRepository3.java:373) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:288) at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:529) at java.lang.ClassLoader.getResource(ClassLoader.java:972) at org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1072) at net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule.initialize(JbossAcegiLoginModule.java:100) 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:585) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756) 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:572) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:506) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:315) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:230) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 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:572) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:506) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:315) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:230) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) So I started to inspect the problem, then I realized that JbossAcegiLoginModule try to find appContextLocation even it doesn't defined. Here is the code from acegisecurity CVS: if (Thread.currentThread().getContextClassLoader().getResource(appContextLocation) == null) { if (super.log.isInfoEnabled()) { super.log.info("cannot locate " + appContextLocation); } throw new IllegalArgumentException("Cannot locate " + appContextLocation); } I think, this should be done when singletonId == null or "".equals(singletonId). Thank you.
    via by Aycan iRiCAN,
  • As written in reference documentation I tried to use an application-policy like this: <application-policy name = "core"> <authentication> <!-- reference doc says JbossSpringLoginModule but this was renamed in cvs --> <login-module code = "net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule" flag = "required"> <module-option name = "singletonId">springRealm</module-option> <module-option name = "key">my_password</module-option> <module-option name = "authenticationManager">authenticationManager</module-option> </login-module> </authentication> </application-policy> I got NullPointerException, here is the log: 2005-09-26 17:25:42,433 INFO [net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule] initializing jboss login module 2005-09-26 17:25:42,434 TRACE [org.jboss.security.plugins.JaasSecurityManager.core] Login failure javax.security.auth.login.LoginException: java.lang.NullPointerException at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(ConcurrentReaderHashMap.java:298) at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:410) at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:197) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromClassLoader(UnifiedLoaderRepository3.java:373) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:288) at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:529) at java.lang.ClassLoader.getResource(ClassLoader.java:972) at org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1072) at net.sf.acegisecurity.adapters.jboss.JbossAcegiLoginModule.initialize(JbossAcegiLoginModule.java:100) 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:585) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756) 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:572) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:506) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:315) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:230) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 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:572) at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:506) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:315) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:230) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) So I started to inspect the problem, then I realized that JbossAcegiLoginModule try to find appContextLocation even it doesn't defined. Here is the code from acegisecurity CVS: if (Thread.currentThread().getContextClassLoader().getResource(appContextLocation) == null) { if (super.log.isInfoEnabled()) { super.log.info("cannot locate " + appContextLocation); } throw new IllegalArgumentException("Cannot locate " + appContextLocation); } I think, this should be done when singletonId == null or "".equals(singletonId). Thank you.
    via by Aycan iRiCAN,
    • javax.security.auth.login.LoginException: java.lang.NullPointerException at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(ConcurrentReaderHashMap.java:298) at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:410) at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:197) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromClassLoader(UnifiedLoaderRepository3.java:373) at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:288) at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:529) at java.lang.ClassLoader.getResource(ClassLoader.java:972) at org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1072)
    No Bugmate found.