1 Reply Latest reply on Jul 6, 2003 5:50 PM by DG

    Create-table not creating

    DG Newbie

      I think I have a problem having the table created automatically.

      I get the following exception:
      org.jboss.deployment.DeploymentException: CMP field for key not found

      I think the root cause is because the tables have not been created.

      My CMP entity beans have previously worked jboss v3.0.0 ... I am trying to build and deply on 3.2.1

      Config and console snippets follow:

      Console:
      ...
      02:32:49,295 INFO [RARMetaData] Loading JBoss Resource Adapter for JDBC 2 XA drivers
      02:32:49,305 INFO [RARMetaData] Required license terms present. See deployment descriptor.
      02:32:49,325 INFO [RARDeployer] nested deployment: file:/F:/ccdev2/jboss-3.2.1_tomcat-4.1.24/server/default/tmp/deploy/server/default/deploy/jboss-xa-jdbc.rar/29.jboss-xa-jdbc.rar-contents/jboss-xa-jdbc.jar
      02:32:49,425 INFO [MainDeployer] Deployed package: file:/F:/ccdev2/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/jboss-xa-jdbc.rar
      02:32:49,465 INFO [MainDeployer] Starting deployment of package: file:/F:/ccdev2/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/hsqldb-ds.xml
      02:32:49,846 INFO [XSLSubDeployer] transformed into doc: [#document: null]
      02:32:50,266 INFO [HypersonicDatabase] Creating
      02:32:50,266 INFO [HypersonicDatabase] Created
      02:32:50,276 INFO [RARDeployment] Creating
      02:32:50,276 INFO [RARDeployment] Created
      02:32:50,296 INFO [JBossManagedConnectionPool] Creating
      02:32:50,306 INFO [JBossManagedConnectionPool] Created
      02:32:50,326 INFO [HypersonicDatabase] Starting
      02:32:50,336 INFO [HypersonicDatabase] Started
      02:32:50,336 INFO [RARDeployment] Starting
      02:32:50,507 INFO [STDOUT] server.properties not found, using command line or default properties
      02:32:50,507 INFO [STDOUT] Opening database: F:\ccdev2\jboss-3.2.1_tomcat-4.1.24\server\default\data\hypersonic\default
      02:32:50,507 INFO [STDOUT] HSQLDB server 1.7.1 is running
      02:32:50,507 INFO [STDOUT] Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
      02:32:50,567 INFO [RARDeployment] Started
      02:32:50,587 INFO [JBossManagedConnectionPool] Starting
      02:32:50,627 INFO [JBossManagedConnectionPool] Started

      ...

      02:32:54,372 INFO [TxConnectionManager] Starting
      02:32:54,492 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@d314cc
      02:32:54,512 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@51fe8a
      02:32:54,522 INFO [JaasSecurityManagerService] Added HsqlDbRealm, org.jboss.security.plugins.SecurityDomainContext@1e45e3 to map
      02:32:54,583 INFO [DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultDS'
      02:32:54,583 INFO [TxConnectionManager] Started

      ...

      02:32:59,740 INFO [EjbModule] Creating
      02:32:59,770 INFO [EjbModule] Deploying Pen
      02:33:01,002 INFO [EjbModule] Deploying TestByte_Array
      02:33:01,062 INFO [EjbModule] Deploying TestInt
      02:33:01,092 INFO [EjbModule] Deploying TestLong
      02:33:01,192 INFO [EjbModule] Deploying TestShort
      02:33:01,222 INFO [EjbModule] Deploying PenTransactionManager
      02:33:01,342 INFO [EntityContainer] Creating
      02:33:01,412 INFO [EntityInstancePool] Creating
      02:33:01,412 INFO [EntityInstancePool] Created
      02:33:01,963 INFO [EntityContainer] Created
      02:33:01,963 INFO [EntityContainer] Creating
      02:33:01,993 INFO [EntityInstancePool] Creating
      02:33:01,993 INFO [EntityInstancePool] Created
      02:33:02,033 INFO [EntityContainer] Created
      02:33:02,043 INFO [EntityContainer] Creating
      02:33:02,073 INFO [EntityInstancePool] Creating
      02:33:02,073 INFO [EntityInstancePool] Created
      02:33:02,083 INFO [EntityContainer] Created
      02:33:02,083 INFO [EntityContainer] Creating
      02:33:02,103 INFO [EntityInstancePool] Creating
      02:33:02,113 INFO [EntityInstancePool] Created
      02:33:02,123 INFO [EntityContainer] Created
      02:33:02,123 INFO [EntityContainer] Creating
      02:33:02,163 INFO [EntityInstancePool] Creating
      02:33:02,163 INFO [EntityInstancePool] Created
      02:33:02,163 INFO [EntityContainer] Created
      02:33:02,173 INFO [StatelessSessionContainer] Creating
      02:33:02,203 INFO [StatelessSessionInstancePool] Creating
      02:33:02,203 INFO [StatelessSessionInstancePool] Created
      02:33:02,224 INFO [StatelessSessionContainer] Created
      02:33:02,224 INFO [EjbModule] Created
      02:33:02,234 INFO [EjbModule] Starting
      02:33:02,234 INFO [EntityContainer] Starting
      02:33:04,176 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: CMP field for key not found: field name=pkid
      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)






      <ejb-jar >
      No Description.
      <display-name>Generated by XDoclet</display-name>

      <enterprise-beans>

      <!--
      To add session beans that you have deployment descriptor info for, add
      a file to your merge directory called session-beans.xml that contains
      the markup for those beans.
      -->

      <!-- Entity Beans -->

      <![CDATA[No Description.]]>

      <ejb-name>Pen</ejb-name>

      ppaf.digitalpaper.ejb.PenHome
      ppaf.digitalpaper.ejb.Pen
      <local-home>ppaf.digitalpaper.ejb.PenLocalHome</local-home>
      ppaf.digitalpaper.ejb.PenLocal

      <ejb-class>ppaf.digitalpaper.ejb.PenCMP</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Pen</abstract-schema-name>
      <cmp-field >
      <![CDATA[]]>
      <field-name>pkid</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[]]>
      <field-name>penId</field-name>
      </cmp-field>
      <primkey-field>pkid</primkey-field>




      java:/DefaultDS
      <type-mapping>Hypersonic SQL</type-mapping>

      <enterprise-beans>


      <ejb-name>Pen</ejb-name>

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

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

      </cmp-field>

      <table-name>Pen</table-name>
      <create-table>true</create-table>
      <remove-table>true</remove-table>
      <tuned-updates>true</tuned-updates>
      <read-only>false</read-only>
      <row-locking></row-locking>






      <jbosscmp-jdbc>
      java:/DefaultDS
      <datasource-mapping>Hypersonic SQL</datasource-mapping>


      <enterprise-beans>


      <ejb-name>Pen</ejb-name>
      <create-table>true</create-table>
      <remove-table>true</remove-table>
      <read-only>false</read-only>
      <table-name>Pen</table-name>

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

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

      </cmp-field>
      <!--
      To define load groups for this entity, write a file named
      jbosscmp-jdbc-load-PenBean.xml and put it in
      your mergedir. Write it according to the following DTD slice:
      <!ELEMENT load-groups (load-group+)>
      <!ELEMENT load-group (load-group-name, description?, field-name+)>
      <!ELEMENT load-group-name (#PCDATA)>
      <!ELEMENT description (#PCDATA)>
      <!ELEMENT field-name (#PCDATA)>
      <!ELEMENT eager-load-group (#PCDATA)>
      <!ELEMENT lazy-load-groups (load-group-name+)>
      -->











      hsqldb-ds.xml
      <!-- $Id: hsqldb-ds.xml,v 1.1.2.4 2003/04/22 20:34:33 d_jencks Exp $ -->

      <local-tx-datasource>
      <!-- remove this depends tag if you are not using the tcp connection url -->
      jboss:service=Hypersonic
      <jndi-name>DefaultDS</jndi-name>
      <!-- for tcp connection, allowing other processes to use the hsqldb database -->
      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
      <!-- for totally in-memory db, not saved when jboss stops. hsql mbean is unnecessary-->
      <!--connection-url>jdbc:hsqldb:.</connection-url-->
      <!-- for in-process db, saved when jboss stops. hsql mbean is unnecessary-->
      <!--connection-url>jdbc:hsqldb:default-db-name</connection-url-->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>
      <user-name>sa</user-name>

      <!--example of how to specify class that determines if exception means connection should be destroyed-->
      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
      <min-pool-size>5</min-pool-size>
      <security-domain>HsqlDbRealm</security-domain>
      </local-tx-datasource>
      <!-- this mbean should be used only when using tcp connections -->

      1701
      true
      default
      false
      true