0 Replies Latest reply on Aug 2, 2004 11:58 AM by Raj Subramani

    <auto-increment/> template error

    Raj Subramani Newbie

      I have two auto generation seq for 2 tables Person & Organisation (database is Firebird 1.5).

      They have been declared in my jbosscmp-jdbc-xml file as follows:


      <entity-commands>
      <entity-command name="person-pk-autogen" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCPkSqlCreateCommand">
      <attribute name="pk-sql">SELECT GEN_ID(PERSONID_GEN,1) FROM RDB$DATABASE</attribute>
      </entity-command>
      <entity-command name="org-pk-autogen" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCPkSqlCreateCommand">
      <attribute name="pk-sql">SELECT GEN_ID(ORGID_GEN,1) FROM RDB$DATABASE</attribute>
      </entity-command>
      </entity-commands>


      The two entities Organisation and Person have auto-increments defines as follows:


      <entity>
      <ejb-name>Organisation</ejb-name>
      <create-table>true</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <table-name>Organisation</table-name>

      <cmp-field>
      <field-name>orgId</field-name>
      <column-name>ORG_ID</column-name>
      <jdbc-type>BIGINT</jdbc-type>
      <sql-type>NUMERIC(18,0)</sql-type>
      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>NAME</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(100)</sql-type>

      </cmp-field>
      <entity-command name="org-pk-autogen"/>
      </entity>

      <entity>
      <ejb-name>Person</ejb-name>
      <create-table>true</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <table-name>Person</table-name>

      <cmp-field>
      <field-name>personId</field-name>
      <column-name>PERSON_ID</column-name>
      <jdbc-type>BIGINT</jdbc-type>
      <sql-type>NUMERIC(18,0)</sql-type>
      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>lastName</field-name>
      <column-name>LAST_NAME</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(100)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>salutation</field-name>
      <column-name>SALUTATION</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(20)</sql-type>

      </cmp-field>
      <entity-command name="person-pk-autogen"/>
      </entity>


      When I start JBoss (3.2.5) I get this error:


      17:03:48,171 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=com.clarologic.contact.domain/Person/LocalHome,service=EJB
      java.lang.IllegalStateException: auto-increment template not found
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.addField(JDBCStartCommand.java:843)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.getEntityCreateTableSQL(JDBCStartCommand.java:696)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:186)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:492)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:396)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:147)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      ...
      ...


      17:03:48,484 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=com.clarologic.contact.domain/Person/LocalHome,service=EJB
      RuntimeMBeanException: java.lang.IllegalStateException: auto-increment template not found
      Cause: java.lang.IllegalStateException: auto-increment template not found
      at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:82)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:367)
      at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



      Any pointers would be appreciated.

      Cheers
      -raj