0 Replies Latest reply on Nov 12, 2003 4:02 AM by t.cockle

    Deploying M2M with CMP

    t.cockle

       

      "t.cockle@staffs.ac.uk" wrote:
      "t.cockle@staffs.ac.uk" wrote:
      Hi,

      I have an odd problem I was hopping you can help with. I am using Middlegen, XDoclet and JBoss (with a mysql db). The error occurs at deployment but I am not sure where things are going. Sorry this is a bit of a long one but I am stumped. To make this a little easier to navigate I have put code fragments in separate text files.

      The error I get is this:

      08:20:47,450 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:
      <none>
      Incompletely deployed packages:
      <none>
      MBeans waiting for classes:
      <none>
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.RelationshipTypeLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.FormLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=middlegen.sequencegenerator.ejb.SequenceLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.InformationLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.DiaryLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.PartLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.PersonLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.QuestionLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId, ObjectName: jboss.j2ee:jndiName=Alpha_serendipity.FormResponseLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not found: field name=personId]
      08:20:47,461 INFO [URLDeploymentScanner] Started

      This looks to me like JBoss is expecting to find a field personId in all the entity beans I guess that is the problem because only the person entity bean has a personId field. I have tried a couple of things that I will summaries shortly but first I will explain what I have.

      I have two sets of entity beans, the first represents data collected in forms and the second set represents people and relationships. Everything was fine until I altered how people/relationship set by joining them with M2M.

      I generate the database tables as in the attached createDB.txt
      I then get middlegen to create the entity beans as in attached useMiddlegen.txt

      Every seems fine at this point the middlegen gui displays the M2M relationship. There are a couple of warnings as fkcmp="false" also middlegen thinks that cmp20 readonly is set to true: but I have defined it as false in the build.xml.

      I generate the interfaces using XDoclet as in the attached useXDoclet.txt

      I have looked over the deployment descriptors and they seem fine, as do the entity beans and interfaces. I have attached examples.

      Originally the relationshipTypeBean was just called relationshipBean. I was getting the above error message but it was looking for relationshipId. After looking over the source code I thought I would change relationship to relationshipType to make sure I was interpreting the error message correctly. However when the code was regenerated it altered the order in the create method of the (join table) personRelationship. This altered the error message so that now it is looking for personId.

      Secondly I dropped all the tables in the mysql database to allow JBoss to create them but is seams that jboss does not get that far.


      Does any of this make sense to someone out there! Thanks in advance for any help

      Tim