2 Replies Latest reply on Nov 5, 2002 3:48 AM by dragospd

    Error on deploying a cmp bean

    dragospd

      Hi

      i use a mysql database to store authentication information and i try to configure jboss to use that database for container managed security with DatabaseServerLoginModule. when I try to deploy a simple cmp ejb i obtain an error like this:

      09:35:10,634 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.3/server/default/deploy/sgi.jar
      09:35:10,759 INFO [EjbModule] Creating
      09:35:10,775 INFO [EjbModule] Deploying Service
      09:35:10,993 INFO [EjbModule] Created
      09:35:10,993 INFO [EjbModule] Starting
      09:35:16,368 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=Service,service=EJB
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:707)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:531)

      the question is: what principal is null? where do i need to set up a principal? in bean code(or xml) or in security configuration files?

      Thanx

        • 1. Re: Error on deploying a cmp bean
          noel.rocher

          Hi,

          As your xxx-service.xml should tell you, JAAS information should be configured in your login-config.xml in the conf directory of your server (probably the "default" one)

          Hope this helps.

          Noel

          • 2. Re: Error on deploying a cmp bean
            dragospd

            here is the login-config.xml part:

            <application-policy name = "MySqlDBRealm">

            <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
            flag = "required">
            <module-option name="dsJndiName">
            java:/MySqlDS
            </module-option>
            <module-option name="principalsQuery">
            SELECT passwd FROM sgitest.user WHERE user_id=?
            </module-option>
            <module-option name="rolesQuery">
            SELECT role_id, 'roles' FROM user2role
            WHERE user_id=?
            </module-option>
            <module-option name="managedConnectionFactoryName">
            jboss.jca:service=LocalTxDS,name=MySqlDS
            </module-option>
            </login-module>

            </application-policy>

            i read jboss tutorial where, for databaseserverloginmodule there is no "principal" module-option entry (and it's seems logical for me). On the other side in the example directory of jboss with mysql-service.xml example, in login module configuration part written as an example to put in login-config.xml there are almost total different module-options (principal, username, password). my question is: witch one configuration is correct since I want to use jaas with databaseserverloginmodule as authentication module.
            And one more question here: where I have to put database connection username and password? in url connection string? in mysql-service.xml config-property entries(Username and Password)?

            thanks for your time
            Dragos