4 Replies Latest reply on Apr 8, 2003 12:07 AM by Andrew McConnell

    Newbie CMP deployment exception

    Andrew McConnell Newbie

      I'm getting a nasty stack trace trying to deploy my CMP based entity beans under JBoss 3.2RC3, and don't really know how to do any more debugging than I've already done.

      I've included the stack trace, and I'm attaching my jbosscmp-jdbc.xml file. I've been fighting this for 3 days and am getting nowhere fast. Thanks for any help!

      2003-04-02 20:12:51,146 ERROR [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: CMP field for key not found: field name=lineupId
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.init(JDBCRelationshipRoleMetaData.java:157)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(JDBCRelationMetaData.java:313)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:404)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:799)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:492)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:424)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:170)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:339)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1

        • 1. Re: Newbie CMP deployment exception
          Juha Lindfors Master

          Try simplifying your relationship config a bit by removing the jbosscmp-jdbc.xml config for your FantasyLineUp entity and just use the default relationship mapping that you get from ejb-jar.xml.

          There used to be an issue with keys that were both PK and FK (as in this would not work) in JBoss 3.0 but I thought it had been fixed in 3.2 (or maybe its something completely different, staring all that XML hurts my eyes).

          Anyway, as a general rule, when the stuff is not working, simplify your config back to defaults and once that works start adding additional config (in jbosscmp-jdbc.xml) bit by bit. Easier to debug!

          Anyway, somethings wrong with the relationship config.

          • 2. Re: Newbie CMP deployment exception
            Andrew McConnell Newbie

            Through a process of trial and error, I've narrowed the problem down significantly.

            First, I had to patch a template in Middlegen. This fixed several of my problems! However, now that that has been taken care of, I think that I've found a defect in 3.2RC3.

            I have a table that contains 2 FKs both to the same column on a different table. When I remove one of the FKs, it deploys fine, but with both keys in place, I get:

            Depends On Me: org.jboss.deployment.DeploymentException: CMP field for key not
            found: field name=lineupId, ObjectName: jboss.j2ee:jndiName=com.ff.interfaces.FantasyTeamPlayerLocalHome,service=EJB
            state: FAILED.

            Any ideas?

            • 3. Re: Newbie CMP deployment exception
              Juha Lindfors Master

              It might be worth a shot to try the 3.2 RC5 and see if the same problem still exists. Also should probably validate your descriptors against the DTDs if there are problems with the generator software you are using.

              I'm not sure where that problem stems from, does your patched middlegen generate different content in the XML files now?

              • 4. Re: Newbie CMP deployment exception
                Andrew McConnell Newbie

                I just d/led RC4 and got the same exception. I'll put together a test case and submit it as a bug. Thanks for your help!