3 Replies Latest reply on Jan 2, 2004 12:38 AM by shogun1234

    [cmp-cmr] CMP field for key not found

    shogun1234

      hi,
      i follow up Rick Hightower's cmp-cmr sample program (http://www.rickhightower.com/ejbcmpcmrxdoclet/EJB20CMPCMR.html) to
      learn how to use xdoclet-cmr in jboss env and encounter a problem.
      it issues error "CMP field for key not found", as (A):
      what may cause such kind of error occurred?
      i appreciate any suggestions, sincerely.
      thank you very much.
      the env i utilize is jboss-3.0.4_tomcat-4.1.12,
      j2sdk1.4.1_01, xdoclet-bin-1.2b3.

      ===========(A)===========
      14:30:29,734 ERROR [URLDeploymentScanner]
      MBeanException: Exception in MBean ope
      ration 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName:
      jboss.j2ee:jndiName=UserInfoLocal,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me:
      org.jboss.deployment.DeploymentException: CMP field
      for key not
      found: field name=EMAIL, ObjectName:
      jboss.j2ee:jndiName=UserLocal,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me:
      org.jboss.deployment.DeploymentException: CMP field
      for key not
      found: field name=EMAIL, ObjectName:
      jboss.j2ee:jndiName=RoleLocal,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me:
      org.jboss.deployment.DeploymentException: CMP field
      for key not
      found: field name=EMAIL, ObjectName:
      jboss.j2ee:jndiName=GroupLocal,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me:
      org.jboss.deployment.DeploymentException: CMP field
      for key not
      found: field name=EMAIL]
      ========================

        • 1. Re: [cmp-cmr] CMP field for key not found
          lekkim

          The "CMP field for key" error signals that you are trying to refer to a CMP bean using a primary key field name that doesn't exist in the bean you are refering to.

          E.g. don't try to refer to the Customer bean (primary key called getCustomerId()) using userId as the field name but use customerId as the field name.

          • 2. Re: [cmp-cmr] CMP field for key not found
            lekkim

            Also - remember that the key field names are translated into method names and are case sensitive. If you key method is called getEmail() the key should be email and not EMAIL.

            • 3. Re: [cmp-cmr] CMP field for key not found
              shogun1234

               

              "lekkim" wrote:
              Also - remember that the key field names are translated into method names and are case sensitive. If you key method is called getEmail() the key should be email and not EMAIL.

              yes, you're right. and the problem is occurred at the tag used via xdoclet.
              for instance, the tag marks relation field originally using upperclass, EMAIL. that's the place where issuing error.
              now it works fine. thanks your help, sincerely.

              *
              * @jboss:relation
              * fk-column="email" -> EMAIL
              * related-pk-field="email" -> EMAIL
              * ...