1 Reply Latest reply on Dec 17, 2003 6:19 PM by juha

    DatabaseServerLoginModule error

      Hi,

      I'm trying to replace the LdapLoginModule by the DatabaseServerLoginModule and I'm having a strange error.

      As requested, I created a table for users and one for roles (in fact this is the same table, but I have 2 distinct queries).

      From my web app, I can access the database (I use Hibernate) and do whatever I want. But not to authenticate my users. I 'm getting the following exception whenever a user tries to login :

      org.jboss.util.NestedSQLException: Wrong credentials passed to getConnection!; - nested throwable: (org.jboss.resource.J
      BossResourceException: Wrong credentials passed to getConnection!)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
       at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:96)
       at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:143)
       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:324)
       at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
       at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
       at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
       at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
       at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:462)
       at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:417)
       at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:244)
       at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:219)
       at org.jboss.jetty.security.JBossUserRealm$JBossUserPrincipal.isAuthenticated(JBossUserRealm.java:92)
       at org.jboss.jetty.security.JBossUserRealm$JBossUserPrincipal.authenticate(JBossUserRealm.java:154)
       at org.jboss.jetty.security.JBossUserRealm.authenticate(JBossUserRealm.java:323)
       at org.mortbay.http.BasicAuthenticator.authenticated(BasicAuthenticator.java:50)
       at org.mortbay.http.SecurityConstraint.check(SecurityConstraint.java:401)
       at org.mortbay.http.HttpContext.checkSecurityConstraints(HttpContext.java:1456)
       at org.mortbay.jetty.servlet.ServletHttpContext.checkSecurityConstraints(ServletHttpContext.java:137)
       at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:235)
       at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
       at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
       at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
       at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      ....
      


      I'm using mysql on a Windows 2003 server. My version of JBosss is 3.2.1.

      I can also post my mysql-ds.xml file as well login-config.xml if someone needs it (didn't find how to attach files - not my day -).

      Regards.

      Olivier.


        • 1. Re: DatabaseServerLoginModule error

          what's the username and password to access the table you're trying to use and have you configured that in your mysql-ds.xml file?

          (The forum software doesn't support attachments, sorry :-/