1 Reply Latest reply on Aug 27, 2002 11:57 AM by dsundstrom

    "should have a cmp-field named MIN_VALUE"

    mnelson

      I'm new to EJBs and JBoss so there is probably an obvious answer to my problem. I'm using JBoss 3.0.1 and the entity bean I am having trouble with is using CMP 1.1.

      I am getting a warning and an exception (there is other verbiage but it doesn't seem significant):
      Warning: At least one field in the primary key class must be non-static.
      DeploymentException: Bean rAddress has PK of type java.lang.Integer, so it should have a cmp-field named MIN_VALUE

      The O'Reilly book doesn't say anything about having to have a MIN_VALUE field and doesn't show it in any of the examples so I suspect I am doing something wrong.

      Below is my deployment descriptor.

      Can someone tell me what my problem is?

      Michael

      ------------------------------------------------------
      <ejb-jar>
      <display-name>EJBs</display-name>
      <enterprise-beans>
      <ejb-name>rAddress</ejb-name>
      banana.cAddressBook.rAddressBook.rAddressHome
      banana.cAddressBook.rAddressBook.rR_Address
      <ejb-class>banana.cAddressBook.rAddressBook.rAddressBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <prim-key-field>id</prim-key-field>
      False
      <cmp-version>1.1</cmp-version>
      <cmp-field> <field-name>id</field-name> </cmp-field>
      <cmp-field> <field-name>country</field-name> </cmp-field>
      <cmp-field> <field-name>postalCode</field-name> </cmp-field>
      <cmp-field> <field-name>zip</field-name> </cmp-field>
      <cmp-field> <field-name>state</field-name> </cmp-field>
      <cmp-field> <field-name>city</field-name> </cmp-field>
      <cmp-field> <field-name>addressLine2</field-name> </cmp-field>
      <cmp-field> <field-name>addressLine1</field-name> </cmp-field>
      <resource-ref>
      <res-ref-name>jdbc/AddressDatasource</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>rAddress</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

        • 1. Re: "should have a cmp-field named MIN_VALUE"
          dsundstrom

          If you are new to EJB you should start with CMP 2.0 and don't write your own pk classes.

          I think the problem you are having is caused by a bad deployment descriptor. Did you download this from the OReilly site or did you code it by hand?

          You are required (by the spec and JBoss) to declare the EJB 2.0 DOCTYPE in your ejb-jar.xml file, and this will help you identify the bad tag(s).