1 Reply Latest reply on Jul 24, 2002 9:03 AM by Tung Dang

    Failed to load users/passwords/role files

    Tung Dang Novice

      Hi!

      Here are my configuration files:

      ====== ejb-jar.xml =======

      <?xml version="1.0"?>


      <ejb-jar>
      AccessControl-Modul
      <display-name>AccessControl</display-name>

      <enterprise-beans>

      a test bean
      <display-name>ProductBean</display-name>
      <ejb-name>Product</ejb-name>
      ProductHome
      Product
      <ejb-class>ProductBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False

      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>ProductSchema</abstract-schema-name>
      <cmp-field><field-name>productID</field-name></cmp-field>
      <cmp-field><field-name>description</field-name></cmp-field>
      <primkey-field>productID</primkey-field>


      </enterprise-beans>

      </ejb-jar>
      ====== ejb-jar.xml =======


      ====== jboss.xml =======
      <?xml version="1.0" encoding="UTF-8"?>


      false
      <container-configurations />
      <resource-managers />

      <enterprise-beans>

      <ejb-name>Product</ejb-name>
      <jndi-name>Product</jndi-name>


      </enterprise-beans>

      ====== jboss.xml =======


      ====== jbosscmp-jdbc.xml =======

      java:/ProductDS
      <datasource-mapping>DB2</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <pk-constraint>true</pk-constraint>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>



      <enterprise-beans>

      <ejb-name>Product</ejb-name>
      <table-name>product</table-name>

      <cmp-field>
      <field-name>productID</field-name>
      <column-name>productID</column-name>
      <jdbc-type>CHAR</jdbc-type>
      <sql-type>CHAR(20)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>description</field-name>
      <column-name>description</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(100)</sql-type>
      </cmp-field>


      </enterprise-beans>

      </jbosscmp-jdbc>

      ====== jbosscmp-jdbc.xml =======

      While deployment I got the following errors:

      2002-07-24 11:26:31,203 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Product] jar:file:/C:/Programme/jboss 3.0 neu/server/default/tmp/deploy/server/default/deploy/prod.jar/79.prod.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
      2002-07-24 11:26:31,546 ERROR [org.jboss.security.auth.spi.UsersRolesLoginModule] Failed to load users/passwords/role files
      java.io.IOException: Properties file users.properties not found
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadProperties(UsersRolesLoginModule.java:212)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:193)

      ...
      2002-07-24 11:26:31,593 ERROR [org.jboss.ejb.EjbModule] Initialization failed
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:707)

      What does this mean with users/passwords/role files? What should I do?

      I am using JBoss 3.0, JDK 1.3 and DB2 V7.1

      Thanks in advance.

        • 1. Re: Failed to load users/passwords/role files
          Tung Dang Novice

          I got it:

          I added the following information in
          %JBOSS%\server\default\conf\login-config.xml


          ...
          <application-policy name = "DB2DbRealm">

          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
          <module-option name = "principal">db2admin</module-option>
          <module-option name = "userName">user</module-option>
          <module-option name = "password">password</module-option>
          <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DB2DS </module-option>
          </login-module>

          </application-policy>
          ...


          It works fine!!!

          I have a question:
          You can have this in your xxx-service.xml, too. Is is better to put this information in xxx-service.xml or in login-config.xml?