Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-936

EJB 2.x Entity Bean Audit Field Deployment Issue

    Details

    • Steps to Reproduce:
      Hide

      1) Create an EJB 2.x entity bean with <audit> tags defined in jbosscmp-jdbc.xml much like this:

      <audit>
      <created-by>
      <column-name>someUserField</column-name>
      </created-by>
      <created-time>
      <column-name>someDateField</column-name>
      </created-time>
      <updated-by>
      <column-name>someUserField</column-name>
      </updated-by>
      <updated-time>
      <column-name>someDateField</column-name>
      </updated-time>
      </audit>
      2) Attempt to deploy the EJB.

      Show
      1) Create an EJB 2.x entity bean with <audit> tags defined in jbosscmp-jdbc.xml much like this: <audit> <created-by> <column-name>someUserField</column-name> </created-by> <created-time> <column-name>someDateField</column-name> </created-time> <updated-by> <column-name>someUserField</column-name> </updated-by> <updated-time> <column-name>someDateField</column-name> </updated-time> </audit> 2) Attempt to deploy the EJB.

      Description

      Upon deployment of an EJB 2 entity bean that has <audit> tags specified in the jbosscmp-jdbc.xml file you will get this exception:

      Caused by: java.lang.RuntimeException: JBAS010732: Couldn't create entity command
      at org.jboss.as.cmp.jdbc.JDBCCommandFactory.createCreateEntityCommand(JDBCCommandFactory.java:132)
      at org.jboss.as.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:215)
      at org.jboss.as.cmp.jdbc.JdbcStoreManagerStartService.start(JdbcStoreManagerStartService.java:44)
      ... 5 more
      Caused by: java.lang.RuntimeException: JBAS010726: No security-domain configured but created-by specified
      at org.jboss.as.cmp.jdbc.JDBCAbstractCreateCommand.initGeneratedFields(JDBCAbstractCreateCommand.java:148)
      at org.jboss.as.cmp.jdbc.JDBCAbstractCreateCommand.init(JDBCAbstractCreateCommand.java:87)
      at org.jboss.as.cmp.jdbc.JDBCInsertPKCreateCommand.init(JDBCInsertPKCreateCommand.java:43)
      at org.jboss.as.cmp.jdbc.JDBCCommandFactory.createCreateEntityCommand(JDBCCommandFactory.java:130)
      ... 7 more

      In looking at the source code where the error occurs in org.jboss.as.cmp.jdbc.JDBCAbstractCreateCommand, the securityManager is not being initialized in the init() method as it is in other version of JBoss. This causes an exception to be thrown from the initGeneratedFields() method.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dmlloyd David Lloyd
                Reporter:
                javacoryd Cory Dahlstrom
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: