5 Replies Latest reply on Apr 5, 2004 10:41 AM by chawla1975

    CMP field for key not found

    chamesh

      I am getting "CMP field for key not found"

      for following ejb-jar.xml


      <ejb-relation>
      <ejb-relation-name>user-agents</ejb-relation-name>

      <ejb-relationship-role>
      <ejb-relationship-role-name>user-is-agent</ejb-relationship-role-name>

      < multiplicity > One </ multiplicity >

      <relationship-role-source>
      <ejb-name>User</ejb-name>
      </relationship-role-source>

      <cmr-field>
      <cmr-field-name>agent</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role>

      <ejb-relationship-role-name>agent-is-user</ejb-relationship-role-name>

      < multiplicity >One</ multiplicity >

      <relationship-role-source>
      <ejb-name>Agent</ejb-name>
      </relationship-role-source>

      <cmr-field>
      <cmr-field-name>user</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>



      and jbosscmp-jdbc.xml extract is



      <ejb-relation>
      <ejb-relation-name>user-agents</ejb-relation-name>
      <foreign-key-mapping/>

      <ejb-relationship-role>
      <ejb-relationship-role-name>user-is-agent</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>unprkey</field-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>agent-is-user</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name> unfrkey </field-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      </ejb-relation>


      Thanks in adavnce

        • 1. Re: CMP field for key not found
          aloubyansky

          Does user have unprkey field? And does agent have unfrkey field?

          • 2. Re: CMP field for key not found
            chamesh

            Yes, user have unprkey field and agent does have unfrkey field.
            Both are primitive data types of int

            • 3. Re: CMP field for key not found
              chawla1975

              Did you resolve this problem? We are also having the same problem?

              Thanks,
              Vikas

              • 4. Re: CMP field for key not found
                aloubyansky

                And when you use foreign key mapping you should have key-fields specified only on one side.

                • 5. Re: CMP field for key not found
                  chawla1975

                  Thanks,

                  We have a table which has a compound primary key consisting of 4 different fields. These fields are defined as the cmp-fields.

                  Regards,
                  Vikas


                  <ejb-name>ABC</ejb-name>
                  <local-home>ABCHome</local-home>
                  ABCLocal
                  <ejb-class>ABCBean</ejb-class>
                  <persistence-type>Container</persistence-type>
                  <prim-key-class>ABCPK</prim-key-class>
                  false
                  <cmp-version>2.x</cmp-version>
                  <abstract-schema-name>CONFIG_PARAMETER_META_TBL</abstract-schema-name>
                  <cmp-field>
                  <field-name>attributeName</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>domainName</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>componentName</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>defaultValue</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>applicationType</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>serverName</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>attributeRange</field-name>
                  </cmp-field>
                  <cmp-field>
                  <field-name>attributeDescription</field-name>
                  </cmp-field>