1 Reply Latest reply on Apr 21, 2005 7:49 PM by Michael Dinsmore

    DatabaseServerLoginModule SQL Failure

    Ian Mckay Newbie


      Im trying to set up database authentication following the startguide section 4.3.2. When accessing my web app i get forwarded to a login.jsp i enter my details and i get this error.

      ERROR [DatabaseServerLoginModule] SQL failure
      java.sql.SQLException: Table not found: ROLES in statement [select Role, RoleGroup from Roles where PrincipalID=?]
      at org.hsqldb.jdbc.jdbcUtil.throwError(Unknown Source)

      My web.xml is as follows

      Will only allow users of role admin to access the web server

      My jboss-web.xml looks like:


      And my login-config.xml is:

      <!-- A Security Configuration for the UDK Server
      <application-policy name="UDKServer">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
      <module-option name="dsJndiName">java:/DefaultDS</module-option>
      <module-option name="principalsQuery">
      select passwd from Users where username=?
      select userRoles, 'Roles' from UserRoles where username=?


      Ive created the Users and userRoles tables all following the guide. But it seems to want to reference another table.

      Can someone help me, ive searched this forum and the guide and can't find what im doing wrong.


        • 1. Re: DatabaseServerLoginModule SQL Failure
          Michael Dinsmore Newbie

          Are you sure you have the correct SQL for the select of the userRoles fro mthe table? As you can see from the error itself, the SQL exception is telling you that there is no table called ROLES whereas you have a table called userRoles. I think you might have cut and pasted the original SQL statement the example has which refers to the ROLES table.