4 Replies Latest reply on May 31, 2004 7:39 AM by sbocquet

    JBoss audit fields

    sbocquet Newbie

      Hi,

      I try to add audit fields on my EJBs. I've added the corresponding tags on my jbosscmp-jdbc.xml file for my beans.

       <entity>
       <ejb-name>Roles</ejb-name>
       <create-table>true</create-table>
       <remove-table>false</remove-table>
       <table-name>Roles</table-name>
      
       <cmp-field>
       <field-name>roleId</field-name>
       <column-name>RoleId</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>name</field-name>
       <column-name>Name</column-name>
       <not-null/>
       </cmp-field>
       <cmp-field>
       <field-name>description</field-name>
       <column-name>Description</column-name>
       </cmp-field>
       <audit>
       <created-by>
       <field-name>createdBy</field-name>
       <column-name>CreatedBy</column-name>
       </created-by>
       <created-time>
       <field-name>createdTime</field-name>
       <column-name>CreatedTime</column-name>
       </created-time>
       <updated-by>
       <field-name>updatedBy</field-name>
       <column-name>UpdatedBy</column-name>
       </updated-by>
       <updated-time>
       <field-name>updatedTime</field-name>
       <column-name>UpdatedTime</column-name>
       </updated-time>
       </audit>
       </entity>
      


      I have also added security infos on my jboss-web.xml file... and the login mechanism is working correctly (by DatabaseLoginModule).
      <jboss-web>
       <security-domain>java:/jaas/Bet4Fun</security-domain>
      ...
      


      But when Jboss start to deploy my EJB, I have the following error

      18:51:34,241 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: No security-domain configured but created-by specified
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.initGeneratedFields(JDBCAbstractCreateCommand.java:172)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.init(JDBCAbstractCreateCommand.java:85)
      ...
      


      The audit fields are not created in database.
      Is something missing in my descriptors ? Have I forgotten something ?

      Thanks for the help,