2 Replies Latest reply on May 7, 2003 4:43 PM by govindadasa

    Urgent CMP field help needed

    govindadasa Newbie

      I am trying to make one-one CMP bean running. But I get this exception.
      I have tables Av-AvOrg. Av has foriegn key to AvOrg.
      but not AvOrg has reference to Av. So its unidirectional.
      Do I need to declare cmr fileds too in cmp-field?


      ================================
      org.jboss.deployment.DeploymentException: CMP field for key not found: field nam
      e=avOrg
      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.(J
      DBCRelationMetaData.java:313)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:404)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
      lFileLoader.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
      a(JDBCStoreManager.java:737)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
      StoreManager.java:430)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:372)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:170)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:339)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy39.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:347)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy21.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:541)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:280)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:421)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:273)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:242)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:597)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:361)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:268)
      at org.jboss.Main.boot(Main.java:156)
      at org.jboss.Main$1.run(Main.java:394)
      at java.lang.Thread.run(Thread.java:536)
      13:41:00,508 WARN [ServiceController] Problem starting service jboss.j2ee:jndiN
      ame=AvOrganization,service=EJB
      org.jboss.deployment.DeploymentException: CMP field for key not found: field nam
      e=avOrg
      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.(J
      DBCRelationMetaData.java:313)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:404)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
      lFileLoader.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
      a(JDBCStoreManager.java:737)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
      StoreManager.java:430)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:372)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:170)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:339)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:392)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy39.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:347)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      ==========================
      ejb-jar.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar id="ejb-jar_ID">
      <display-name>AV</display-name>
      <enterprise-beans>

      <ejb-name>AvOrganization</ejb-name>
      <local-home>com.test.ejb.av.AvOrganizationLocalHome</local-home>
      com.test.ejb.av.AvOrganizationLocal
      <ejb-class>com.test.ejb.av.AvOrganizationBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>AvOrganization</abstract-schema-name>
      <cmp-field>
      <field-name>roid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      </cmp-field>
      <primkey-field>roid</primkey-field>
      <ejb-local-ref>
      <ejb-ref-name>Av</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.test.ejb.av.AvRemoteHome</local-home>
      com.test.av.AvTestRemote
      <ejb-link>Av</ejb-link>
      </ejb-local-ref>




      <ejb-name>Av</ejb-name>
      <local-home>com.test.ejb.av.AvRemoteHome</local-home>
      com.registrypro.ejb.av.AvRemote
      <ejb-class>com.test.ejb.av.AvBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>AVTest</abstract-schema-name>
      <cmp-field>
      <field-name>roid</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>status</field-name>
      </cmp-field>
      <ejb-local-ref>
      <ejb-ref-name>AvOrganization</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.test.ejb.av.AvOrganizationLocalHome</local-home>
      com.test.ejb.av.AvOrganizationLocal
      <ejb-link>Av</ejb-link>
      </ejb-local-ref>

      <primkey-field>roid</primkey-field>

      </enterprise-beans>


      <ejb-relation>
      <ejb-relation-name>Av-AvOrg</ejb-relation-name>

      <ejb-relationship-role>
      <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relationship-role-name>

      One

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

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

      <ejb-relationship-role>
      <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relationship-role-name>

      One

      <relationship-role-source>
      <ejb-name>AvOrganization</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>

      </ejb-jar>

      ===================================
      jboss-cmp.xml

      <jbosscmp-jdbc>

      java:/dotpro
      <datasource-mapping>MS SQLSERVER2000</datasource-mapping>
      <create-table>true</create-table>
      <remove-table>false</remove-table>
      <pk-constraint>true</pk-constraint>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>


      <enterprise-beans>


      <ejb-name>AvOrganization</ejb-name>
      <table-name>AvOrganization</table-name>

      <cmp-field>
      <field-name>roid</field-name>
      <column-name>Roid</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>Name</column-name>
      </cmp-field>




      <ejb-name>Av</ejb-name>
      <table-name>AVTest</table-name>

      <cmp-field>
      <field-name>roid</field-name>
      <column-name>Roid</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>status</field-name>
      <column-name>Status</column-name>
      </cmp-field>

      <cmp-field>
      <field-name>name</field-name>
      <column-name>Name</column-name>
      </cmp-field>


      </enterprise-beans>


      <ejb-relation>
      <ejb-relation-name>Av-AvOrg</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relationship-role-name>
      <fk-constraint>true</fk-constraint>
      <key-fields>
      <key-field>
      <field-name>avOrg</field-name>
      <column-name>org_id</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relationship-role-name>
      <key-fields/>
      </ejb-relationship-role>
      </ejb-relation>


      </jbosscmp-jdbc>

        • 1. Re: Urgent CMP field help needed
          govindadasa Newbie

          Help please!

          > I am trying to make one-one CMP bean running. But I
          > get this exception.
          > I have tables Av-AvOrg. Av has foriegn key to AvOrg.
          > but not AvOrg has reference to Av. So its
          > unidirectional.
          > Do I need to declare cmr fileds too in cmp-field?
          >
          >
          > ================================
          > org.jboss.deployment.DeploymentException: CMP field
          > for key not found: field nam
          > e=avOrg
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
          > pRoleMetaData.
          > loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
          > pRoleMetaData.
          > init(JDBCRelationshipRoleMetaData.java:157)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMe
          > aData.(J
          > DBCRelationMetaData.java:313)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicatio
          > MetaData. >(JDBCApplicationMetaData.java:404)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoa
          > er.load(JDBCXm
          > lFileLoader.java:75)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJD
          > CEntityMetaDat
          > a(JDBCStoreManager.java:737)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initSt
          > reManager(JDBC
          > StoreManager.java:430)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(
          > DBCStoreManage
          > r.java:372)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPP
          > rsistenceManag
          > er.java:170)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.EntityContainer.startService(EntityConta
          > ner.java:339)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
          > Support.java:1
          > 92)
          > at
          > at
          > at
          > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
          > Method)
          > at
          > at
          > at
          > t
          > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
          > dAccessorImpl.
          > java:39)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController$ServiceProxy.invoke
          > ServiceControl
          > ler.java:966)
          > at $Proxy11.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController.start(ServiceContro
          > ler.java:392)
          > at
          > at
          > at
          > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy39.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.EjbModule.startService(EjbModule.java:34
          > )
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
          > Support.java:1
          > 92)
          > at
          > at
          > at
          > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
          > Method)
          > at
          > at
          > at
          > t
          > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
          > dAccessorImpl.
          > java:39)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController$ServiceProxy.invoke
          > ServiceControl
          > ler.java:966)
          > at $Proxy11.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController.start(ServiceContro
          > ler.java:392)
          > at
          > at
          > at
          > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy21.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:541)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.start(MainDeployer.j
          > va:832)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
          > ava:640)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
          > ava:613)
          > at
          > at
          > at
          > t
          > sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy7.deploy(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.scanner.URLDeploymentScanner.depl
          > y(URLDeploymen
          > tScanner.java:280)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.scanner.URLDeploymentScanner.scan
          > URLDeploymentS
          > canner.java:421)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.scanner.AbstractDeploymentScanner
          > ScannerThread.
          > doScan(AbstractDeploymentScanner.java:200)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.scanner.AbstractDeploymentScanner
          > startService(A
          > bstractDeploymentScanner.java:273)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
          > Support.java:1
          > 92)
          > at
          > at
          > at
          > t sun.reflect.GeneratedMethodAccessor7.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController$ServiceProxy.invoke
          > ServiceControl
          > ler.java:966)
          > at $Proxy0.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController.start(ServiceContro
          > ler.java:392)
          > at
          > at
          > at
          > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy5.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.SARDeployer.start(SARDeployer.jav
          > :242)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.start(MainDeployer.j
          > va:832)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
          > ava:640)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
          > ava:613)
          > at
          > at
          > at
          > t
          > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
          > ava:597)
          > at
          > at
          > at
          > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
          > Method)
          > at
          > at
          > at
          > t
          > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
          > dAccessorImpl.
          > java:39)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy6.deploy(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.system.server.ServerImpl.doStart(ServerImpl.
          > ava:361)
          > at
          > at
          > at
          > t
          > org.jboss.system.server.ServerImpl.start(ServerImpl.ja
          > a:268)
          > at org.jboss.Main.boot(Main.java:156)
          > at org.jboss.Main$1.run(Main.java:394)
          > at java.lang.Thread.run(Thread.java:536)
          > 13:41:00,508 WARN [ServiceController] Problem
          > starting service jboss.j2ee:jndiN
          > ame=AvOrganization,service=EJB
          > org.jboss.deployment.DeploymentException: CMP field
          > for key not found: field nam
          > e=avOrg
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
          > pRoleMetaData.
          > loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
          > pRoleMetaData.
          > init(JDBCRelationshipRoleMetaData.java:157)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMe
          > aData.(J
          > DBCRelationMetaData.java:313)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicatio
          > MetaData. >(JDBCApplicationMetaData.java:404)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoa
          > er.load(JDBCXm
          > lFileLoader.java:75)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJD
          > CEntityMetaDat
          > a(JDBCStoreManager.java:737)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initSt
          > reManager(JDBC
          > StoreManager.java:430)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(
          > DBCStoreManage
          > r.java:372)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPP
          > rsistenceManag
          > er.java:170)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.EntityContainer.startService(EntityConta
          > ner.java:339)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
          > Support.java:1
          > 92)
          > at
          > at
          > at
          > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
          > Method)
          > at
          > at
          > at
          > t
          > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
          > dAccessorImpl.
          > java:39)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController$ServiceProxy.invoke
          > ServiceControl
          > ler.java:966)
          > at $Proxy11.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceController.start(ServiceContro
          > ler.java:392)
          > at
          > at
          > at
          > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
          > Source)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > at
          > at
          > at
          > t java.lang.reflect.Method.invoke(Method.java:324)
          > at
          > at
          > at
          > t
          > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
          > (ReflectedMBea
          > nDispatcher.java:284)
          > at
          > at
          > at
          > t
          > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
          > mpl.java:549)
          > at
          > at
          > at
          > t
          > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
          > va:177)
          > at $Proxy39.start(Unknown Source)
          > at
          > at
          > at
          > t
          > org.jboss.ejb.EjbModule.startService(EjbModule.java:34
          > )
          > at
          > at
          > at
          > t
          > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
          > Support.java:1
          > 92)
          > at
          > at
          > at
          > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
          > Method)
          > at
          > at
          > at
          > t
          > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
          > dAccessorImpl.
          > java:39)
          > at
          > at
          > at
          > t
          > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
          > ingMethodAcces
          > sorImpl.java:25)
          > ==========================
          > ejb-jar.xml
          >
          >
          > <?xml version="1.0" encoding="UTF-8"?>
          > <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,
          > Inc.//DTD Enterprise JavaBeans 2.0//EN"
          > "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
          > <ejb-jar id="ejb-jar_ID">
          > <display-name>AV</display-name>
          > <enterprise-beans>
          >
          > <ejb-name>AvOrganization</ejb-name>
          > <local-home>com.test.ejb.av.AvOrganizationLocalHome
          > /local-home>
          > com.test.ejb.av.AvOrganizationLocal
          > <ejb-class>com.test.ejb.av.AvOrganizationBean</ejb-
          > lass>
          > <persistence-type>Container</persistence-type>
          > <prim-key-class>java.lang.Integer</prim-key-class>
          > False
          > <cmp-version>2.x</cmp-version>
          > <abstract-schema-name>AvOrganization</abstract-sche
          > a-name>
          > <cmp-field>
          > <field-name>roid</field-name>
          > </cmp-field>
          > <cmp-field>
          > <field-name>name</field-name>
          > </cmp-field>
          > <primkey-field>roid</primkey-field>
          > <ejb-local-ref>
          > <ejb-ref-name>Av</ejb-ref-name>
          > <ejb-ref-type>Entity</ejb-ref-type>
          > <local-home>com.test.ejb.av.AvRemoteHome</local-ho
          > e>
          > com.test.av.AvTestRemote
          > <ejb-link>Av</ejb-link>
          > </ejb-local-ref>
          >
          >
          >
          >
          > <ejb-name>Av</ejb-name>
          > <local-home>com.test.ejb.av.AvRemoteHome</local-hom
          > >
          > com.registrypro.ejb.av.AvRemote
          > <ejb-class>com.test.ejb.av.AvBean</ejb-class>
          > <persistence-type>Container</persistence-type>
          > <prim-key-class>java.lang.Integer</prim-key-class>
          > False
          > <cmp-version>2.x</cmp-version>
          > <abstract-schema-name>AVTest</abstract-schema-name>
          >
          > <cmp-field>
          > <field-name>roid</field-name>
          > </cmp-field>
          > <cmp-field>
          > <field-name>name</field-name>
          > </cmp-field>
          > <cmp-field>
          > <field-name>status</field-name>
          > </cmp-field>
          > <ejb-local-ref>
          > <ejb-ref-name>AvOrganization</ejb-ref-name>
          > <ejb-ref-type>Entity</ejb-ref-type>
          > <local-home>com.test.ejb.av.AvOrganizationLocalHom
          > </local-home>
          > com.test.ejb.av.AvOrganizationLocal
          >
          > <ejb-link>Av</ejb-link>
          > </ejb-local-ref>
          >
          > <primkey-field>roid</primkey-field>
          >
          > </enterprise-beans>
          >
          >
          > <ejb-relation>
          >
          >
          >
          >
          > <ejb-relation-name>Av-AvOrg</ejb-relation-name>
          >
          > <ejb-relationship-role>
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relat
          > onship-role-name>
          >
          > One
          >
          > <relationship-role-source>
          > <ejb-name>Av</ejb-name>
          > </relationship-role-source>
          >
          > <cmr-field>
          > <cmr-field-name>avOrg</cmr-field-name>
          > mr-field-name>
          > </cmr-field>
          > </ejb-relationship-role>
          >
          > <ejb-relationship-role>
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relat
          > onship-role-name>
          >
          > One
          >
          > <relationship-role-source>
          > <ejb-name>AvOrganization</ejb-name>
          > </relationship-role-source>
          > </ejb-relationship-role>
          > </ejb-relation>
          >
          > </ejb-jar>
          >
          > ===================================
          > jboss-cmp.xml
          >
          > <jbosscmp-jdbc>
          >
          > java:/dotpro
          > <datasource-mapping>MS
          > ng>MS SQLSERVER2000</datasource-mapping>
          > <create-table>true</create-table>
          > <remove-table>false</remove-table>
          > <pk-constraint>true</pk-constraint>
          >
          >
          >
          >
          >
          > <preferred-relation-mapping>foreign-key</preferred-re
          > ation-mapping>
          >
          >
          > <enterprise-beans>
          >
          >
          > <ejb-name>AvOrganization</ejb-name>
          > <table-name>AvOrganization</table-name>
          >
          > <cmp-field>
          > <field-name>roid</field-name>
          > <column-name>Roid</column-name>
          > </cmp-field>
          > <cmp-field>
          > <field-name>name</field-name>
          > <column-name>Name</column-name>
          > </cmp-field>
          >
          >
          >
          >
          > <ejb-name>Av</ejb-name>
          > <table-name>AVTest</table-name>
          >
          > <cmp-field>
          > <field-name>roid</field-name>
          > <column-name>Roid</column-name>
          > </cmp-field>
          > <cmp-field>
          > <field-name>status</field-name>
          > <column-name>Status</column-name>
          > </cmp-field>
          >
          > <cmp-field>
          > <field-name>name</field-name>
          > <column-name>Name</column-name>
          > </cmp-field>
          >
          >
          > </enterprise-beans>
          >
          >
          > <ejb-relation>
          >
          >
          >
          >
          > <ejb-relation-name>Av-AvOrg</ejb-relation-name>
          > <foreign-key-mapping/>
          > <ejb-relationship-role>
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relat
          > onship-role-name>
          > <fk-constraint>true</fk-constraint>
          > <key-fields>
          > <key-field>
          > <field-name>avOrg</field-name>
          > <column-name>org_id</column-name>
          > </key-field>
          > </key-fields>
          > </ejb-relationship-role>
          >
          > <ejb-relationship-role>
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relat
          > onship-role-name>
          > <key-fields/>
          > </ejb-relationship-role>
          > </ejb-relation>
          >
          >
          > </jbosscmp-jdbc>

          • 2. somebody help
            govindadasa Newbie

            > I am trying to make one-one CMP bean running. But I
            > get this exception.
            > I have tables Av-AvOrg. Av has foriegn key to AvOrg.
            > but not AvOrg has reference to Av. So its
            > unidirectional.
            > Do I need to declare cmr fileds too in cmp-field?
            >
            >
            > ================================
            > org.jboss.deployment.DeploymentException: CMP field
            > for key not found: field nam
            > e=avOrg
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
            > pRoleMetaData.
            > loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
            > pRoleMetaData.
            > init(JDBCRelationshipRoleMetaData.java:157)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMe
            > aData.(J
            > DBCRelationMetaData.java:313)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicatio
            > MetaData. >(JDBCApplicationMetaData.java:404)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoa
            > er.load(JDBCXm
            > lFileLoader.java:75)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJD
            > CEntityMetaDat
            > a(JDBCStoreManager.java:737)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initSt
            > reManager(JDBC
            > StoreManager.java:430)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(
            > DBCStoreManage
            > r.java:372)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPP
            > rsistenceManag
            > er.java:170)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.EntityContainer.startService(EntityConta
            > ner.java:339)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
            > Support.java:1
            > 92)
            > at
            > at
            > at
            > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
            > Method)
            > at
            > at
            > at
            > t
            > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
            > dAccessorImpl.
            > java:39)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController$ServiceProxy.invoke
            > ServiceControl
            > ler.java:966)
            > at $Proxy11.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController.start(ServiceContro
            > ler.java:392)
            > at
            > at
            > at
            > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy39.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.EjbModule.startService(EjbModule.java:34
            > )
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
            > Support.java:1
            > 92)
            > at
            > at
            > at
            > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
            > Method)
            > at
            > at
            > at
            > t
            > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
            > dAccessorImpl.
            > java:39)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController$ServiceProxy.invoke
            > ServiceControl
            > ler.java:966)
            > at $Proxy11.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController.start(ServiceContro
            > ler.java:392)
            > at
            > at
            > at
            > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy21.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:541)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.start(MainDeployer.j
            > va:832)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
            > ava:640)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
            > ava:613)
            > at
            > at
            > at
            > t
            > sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy7.deploy(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.scanner.URLDeploymentScanner.depl
            > y(URLDeploymen
            > tScanner.java:280)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.scanner.URLDeploymentScanner.scan
            > URLDeploymentS
            > canner.java:421)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.scanner.AbstractDeploymentScanner
            > ScannerThread.
            > doScan(AbstractDeploymentScanner.java:200)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.scanner.AbstractDeploymentScanner
            > startService(A
            > bstractDeploymentScanner.java:273)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
            > Support.java:1
            > 92)
            > at
            > at
            > at
            > t sun.reflect.GeneratedMethodAccessor7.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController$ServiceProxy.invoke
            > ServiceControl
            > ler.java:966)
            > at $Proxy0.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController.start(ServiceContro
            > ler.java:392)
            > at
            > at
            > at
            > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy5.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.SARDeployer.start(SARDeployer.jav
            > :242)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.start(MainDeployer.j
            > va:832)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
            > ava:640)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
            > ava:613)
            > at
            > at
            > at
            > t
            > org.jboss.deployment.MainDeployer.deploy(MainDeployer.
            > ava:597)
            > at
            > at
            > at
            > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
            > Method)
            > at
            > at
            > at
            > t
            > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
            > dAccessorImpl.
            > java:39)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy6.deploy(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.system.server.ServerImpl.doStart(ServerImpl.
            > ava:361)
            > at
            > at
            > at
            > t
            > org.jboss.system.server.ServerImpl.start(ServerImpl.ja
            > a:268)
            > at org.jboss.Main.boot(Main.java:156)
            > at org.jboss.Main$1.run(Main.java:394)
            > at java.lang.Thread.run(Thread.java:536)
            > 13:41:00,508 WARN [ServiceController] Problem
            > starting service jboss.j2ee:jndiN
            > ame=AvOrganization,service=EJB
            > org.jboss.deployment.DeploymentException: CMP field
            > for key not found: field nam
            > e=avOrg
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
            > pRoleMetaData.
            > loadKeyFields(JDBCRelationshipRoleMetaData.java:374)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationsh
            > pRoleMetaData.
            > init(JDBCRelationshipRoleMetaData.java:157)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMe
            > aData.(J
            > DBCRelationMetaData.java:313)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicatio
            > MetaData. >(JDBCApplicationMetaData.java:404)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoa
            > er.load(JDBCXm
            > lFileLoader.java:75)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJD
            > CEntityMetaDat
            > a(JDBCStoreManager.java:737)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initSt
            > reManager(JDBC
            > StoreManager.java:430)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(
            > DBCStoreManage
            > r.java:372)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPP
            > rsistenceManag
            > er.java:170)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.EntityContainer.startService(EntityConta
            > ner.java:339)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
            > Support.java:1
            > 92)
            > at
            > at
            > at
            > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
            > Method)
            > at
            > at
            > at
            > t
            > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
            > dAccessorImpl.
            > java:39)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController$ServiceProxy.invoke
            > ServiceControl
            > ler.java:966)
            > at $Proxy11.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceController.start(ServiceContro
            > ler.java:392)
            > at
            > at
            > at
            > t sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
            > Source)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > at
            > at
            > at
            > t java.lang.reflect.Method.invoke(Method.java:324)
            > at
            > at
            > at
            > t
            > org.jboss.mx.capability.ReflectedMBeanDispatcher.invok
            > (ReflectedMBea
            > nDispatcher.java:284)
            > at
            > at
            > at
            > t
            > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServer
            > mpl.java:549)
            > at
            > at
            > at
            > t
            > org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.j
            > va:177)
            > at $Proxy39.start(Unknown Source)
            > at
            > at
            > at
            > t
            > org.jboss.ejb.EjbModule.startService(EjbModule.java:34
            > )
            > at
            > at
            > at
            > t
            > org.jboss.system.ServiceMBeanSupport.start(ServiceMBea
            > Support.java:1
            > 92)
            > at
            > at
            > at
            > t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
            > Method)
            > at
            > at
            > at
            > t
            > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
            > dAccessorImpl.
            > java:39)
            > at
            > at
            > at
            > t
            > sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
            > ingMethodAcces
            > sorImpl.java:25)
            > ==========================
            > ejb-jar.xml
            >
            >
            > <?xml version="1.0" encoding="UTF-8"?>
            > <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,
            > Inc.//DTD Enterprise JavaBeans 2.0//EN"
            > "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
            > <ejb-jar id="ejb-jar_ID">
            > <display-name>AV</display-name>
            > <enterprise-beans>
            >
            > <ejb-name>AvOrganization</ejb-name>
            > <local-home>com.test.ejb.av.AvOrganizationLocalHome
            > /local-home>
            > com.test.ejb.av.AvOrganizationLocal
            > <ejb-class>com.test.ejb.av.AvOrganizationBean</ejb-
            > lass>
            > <persistence-type>Container</persistence-type>
            > <prim-key-class>java.lang.Integer</prim-key-class>
            > False
            > <cmp-version>2.x</cmp-version>
            > <abstract-schema-name>AvOrganization</abstract-sche
            > a-name>
            > <cmp-field>
            > <field-name>roid</field-name>
            > </cmp-field>
            > <cmp-field>
            > <field-name>name</field-name>
            > </cmp-field>
            > <primkey-field>roid</primkey-field>
            > <ejb-local-ref>
            > <ejb-ref-name>Av</ejb-ref-name>
            > <ejb-ref-type>Entity</ejb-ref-type>
            > <local-home>com.test.ejb.av.AvRemoteHome</local-ho
            > e>
            > com.test.av.AvTestRemote
            > <ejb-link>Av</ejb-link>
            > </ejb-local-ref>
            >
            >
            >
            >
            > <ejb-name>Av</ejb-name>
            > <local-home>com.test.ejb.av.AvRemoteHome</local-hom
            > >
            > com.registrypro.ejb.av.AvRemote
            > <ejb-class>com.test.ejb.av.AvBean</ejb-class>
            > <persistence-type>Container</persistence-type>
            > <prim-key-class>java.lang.Integer</prim-key-class>
            > False
            > <cmp-version>2.x</cmp-version>
            > <abstract-schema-name>AVTest</abstract-schema-name>
            >
            > <cmp-field>
            > <field-name>roid</field-name>
            > </cmp-field>
            > <cmp-field>
            > <field-name>name</field-name>
            > </cmp-field>
            > <cmp-field>
            > <field-name>status</field-name>
            > </cmp-field>
            > <ejb-local-ref>
            > <ejb-ref-name>AvOrganization</ejb-ref-name>
            > <ejb-ref-type>Entity</ejb-ref-type>
            > <local-home>com.test.ejb.av.AvOrganizationLocalHom
            > </local-home>
            > com.test.ejb.av.AvOrganizationLocal
            >
            > <ejb-link>Av</ejb-link>
            > </ejb-local-ref>
            >
            > <primkey-field>roid</primkey-field>
            >
            > </enterprise-beans>
            >
            >
            > <ejb-relation>
            >
            >
            >
            >
            > <ejb-relation-name>Av-AvOrg</ejb-relation-name>
            >
            > <ejb-relationship-role>
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relat
            > onship-role-name>
            >
            > One
            >
            > <relationship-role-source>
            > <ejb-name>Av</ejb-name>
            > </relationship-role-source>
            >
            > <cmr-field>
            > <cmr-field-name>avOrg</cmr-field-name>
            > mr-field-name>
            > </cmr-field>
            > </ejb-relationship-role>
            >
            > <ejb-relationship-role>
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relat
            > onship-role-name>
            >
            > One
            >
            > <relationship-role-source>
            > <ejb-name>AvOrganization</ejb-name>
            > </relationship-role-source>
            > </ejb-relationship-role>
            > </ejb-relation>
            >
            > </ejb-jar>
            >
            > ===================================
            > jboss-cmp.xml
            >
            > <jbosscmp-jdbc>
            >
            > java:/dotpro
            > <datasource-mapping>MS
            > ng>MS SQLSERVER2000</datasource-mapping>
            > <create-table>true</create-table>
            > <remove-table>false</remove-table>
            > <pk-constraint>true</pk-constraint>
            >
            >
            >
            >
            >
            > <preferred-relation-mapping>foreign-key</preferred-re
            > ation-mapping>
            >
            >
            > <enterprise-beans>
            >
            >
            > <ejb-name>AvOrganization</ejb-name>
            > <table-name>AvOrganization</table-name>
            >
            > <cmp-field>
            > <field-name>roid</field-name>
            > <column-name>Roid</column-name>
            > </cmp-field>
            > <cmp-field>
            > <field-name>name</field-name>
            > <column-name>Name</column-name>
            > </cmp-field>
            >
            >
            >
            >
            > <ejb-name>Av</ejb-name>
            > <table-name>AVTest</table-name>
            >
            > <cmp-field>
            > <field-name>roid</field-name>
            > <column-name>Roid</column-name>
            > </cmp-field>
            > <cmp-field>
            > <field-name>status</field-name>
            > <column-name>Status</column-name>
            > </cmp-field>
            >
            > <cmp-field>
            > <field-name>name</field-name>
            > <column-name>Name</column-name>
            > </cmp-field>
            >
            >
            > </enterprise-beans>
            >
            >
            > <ejb-relation>
            >
            >
            >
            >
            > <ejb-relation-name>Av-AvOrg</ejb-relation-name>
            > <foreign-key-mapping/>
            > <ejb-relationship-role>
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > <ejb-relationship-role-name>Av-has-a-AvOrg</ejb-relat
            > onship-role-name>
            > <fk-constraint>true</fk-constraint>
            > <key-fields>
            > <key-field>
            > <field-name>avOrg</field-name>
            > <column-name>org_id</column-name>
            > </key-field>
            > </key-fields>
            > </ejb-relationship-role>
            >
            > <ejb-relationship-role>
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > <ejb-relationship-role-name>AvOrg-needs-Av</ejb-relat
            > onship-role-name>
            > <key-fields/>
            > </ejb-relationship-role>
            > </ejb-relation>
            >
            >
            > </jbosscmp-jdbc>