3 Replies Latest reply on Jul 16, 2004 5:17 AM by kleibl

    auto-increment CMP Field and Error Deployment

    morenito9000 Newbie

      Hi all,
      I wrote an Entity Bean with a CMP Field that I want
      to indicate as an "Auto-Increment" field.

      Entity Code:

      /**
       * @ejb.persistence column-name = "ultima_malf"
       * @ejb.interface-method = "local"
       *
       * @jboss.column-name = "ultima_malf"
       * @jboss.persistence not-null = "ultima_malf"
       auto-increment = "ultima_malf"
       *
       * @return
      */
      


      Here is the jbosscmp-jdbc.xml file generated:

      <cmp-field>
       <field-name>ultimaMalf</field-name>
       <column-name>ultima_malf</column-name>
       <not-null/>
      
       <auto-increment/>
      </cmp-field>
      


      Everything seems to be OK but when I try to deploy the bean
      JBoss throws an Exception:

      ERROR [org.jboss.metadata.XmlFileLoader] XmlFileLoader: File jar:file:/webdata/SPDS/jboss-3.2.3/server/xmalf/tmp/deploy/tmp64263XMALF.ear-contents/XMALF-EJB.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 37. Error message: Element type "auto-increment" must be declared.

      ERROR [org.jboss.metadata.XmlFileLoader] XmlFileLoader: File jar:file:/webdata/SPDS/jboss-3.2.3/server/xmalf/tmp/deploy/tmp64263XMALF.ear-contents/XMALF-EJB.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 38. Error message: The content of element type "cmp-field" must match "(field-name,read-only?,read-time-out?,column-name?,not-null?,((jdbc-type,sql-type)|property+)?)".

      [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Invalid XML: file=jar:file:/webdata/SPDS/jboss-3.2.3/server/xmalf/tmp/deploy/tmp64263XMALF.ear-contents/XMALF-EJB.jar!/META-INF/jbosscmp-jdbc.xml
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:296)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:247)
      at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.java:219)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:203)

      It seems that auto-increment TAG is not in the TAG list
      of cmp-field TAG ????

      But in JBoss 3.2.4 Docs auto-increment is still present !

      Many thanks in advance for any help.

      Moreno