0 Replies Latest reply on Dec 20, 2001 10:27 AM by Mouttoucoumarane

    deploying CMP with a composite primary key

    Mouttoucoumarane Newbie

      hi iam trying to deploy a CMP with a composite primarkey. my ejb-jar.xml was:
      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">

      <ejb-jar>
      <display-name>CCM Allocation</display-name>
      <enterprise-beans>


      CCM's Allocation Model
      <ejb-name>AllocationBean</ejb-name>
      org.jboss.docs.allocation.AllocationHome
      org.jboss.docs.allocation.Allocation
      <ejb-class>org.jboss.docs.allocation.AllocationBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>org.jboss.docs.allocation.AllocationPK</prim-key-class>
      False
      <cmp-field><field-name>portfolioId</field-name></cmp-field>
      <cmp-field><field-name>cusip</field-name></cmp-field>
      <cmp-field><field-name>dbCode</field-name></cmp-field>
      <cmp-field><field-name>holdNo</field-name></cmp-field>
      <cmp-field><field-name>coupon</field-name></cmp-field>
      <cmp-field><field-name>purchaseYTM</field-name></cmp-field>
      <cmp-field><field-name>purchaseYTW</field-name></cmp-field>
      <primkey-field></primkey-field>



      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>AllocationBean</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

      and my jaws.xml was:



      <ejb-name>AllocationBean</ejb-name>
      <table-name>HOLDINGS</table-name>
      <pk-constraint>true</pk-constraint>

      <cmp-field>
      <field-name>portfolioId</field-name>
      <column-name>portfolio_id</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR2(8)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>cusip</field-name>
      <column-name>cusip</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR2(9)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>dbCode</field-name>
      <column-name>db_code</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR2(1)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>holdNo</field-name>
      <column-name>hold_no</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>NUMBER</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>coupon</field-name>
      <column-name>coupon</column-name>
      <jdbc-type>double</jdbc-type>
      <sql-type>NUMBER</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>purchaseYTM</field-name>
      <column-name>purchase_ytm</column-name>
      <jdbc-type>double</jdbc-type>
      <sql-type>NUMBER</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>purchaseYTw</field-name>
      <column-name>purchase_ytW</column-name>
      <jdbc-type>double</jdbc-type>
      <sql-type>NUMBER</sql-type>
      </cmp-field>



      But when i try to deploy, the server throws these exceptions and could not deploy the bean..i really need help regarding this as i have to proceed further..i need help..please


      [Container factory] Deploying:file:/C:/JBoss-2.2.2/tmp/deploy/Default/Allocation
      .jar
      [Verifier] Verifying file:/C:/JBoss-2.2.2/tmp/deploy/Default/Allocation.jar/ejb1
      004.jar
      [Verifier]
      Bean : AllocationBean
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java cla
      ss that implements the enterprise bean's business methods.

      [Verifier]
      Bean : AllocationBean
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the enterpri
      se bean's home interface in the home element.

      [Verifier]
      Bean : AllocationBean
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the enterpri
      se bean's remote interface in the remote element.

      [Verifier]
      Bean : AllocationBean
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the enterpri
      se bean's primary key class in the prim-key-class element.

      [Container factory] Deploying AllocationBean
      [Container factory] java.lang.ClassNotFoundException: org.jboss.docs.allocation.
      AllocationHome
      [Container factory] at java.net.URLClassLoader$1.run(URLClassLoader.java:200
      )
      [Container factory] at java.security.AccessController.doPrivileged(Native Me
      thod)
      [Container factory] at java.net.URLClassLoader.findClass(URLClassLoader.java
      :188)
      [Container factory] at java.lang.ClassLoader.loadClass(ClassLoader.java:297)

      [Container factory] at java.lang.ClassLoader.loadClass(ClassLoader.java:253)

      [Container factory] at org.jboss.ejb.EntityContainer.init(EntityContainer.ja
      va:176)
      [Container factory] at org.jboss.ejb.Application.init(Application.java:183)
      [Container factory] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactor
      y.java:337)
      [Container factory] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactor
      y.java:275)
      [Container factory] at java.lang.reflect.Method.invoke(Native Method)
      [Container factory] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1628)
      [Container factory] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1523)
      [Container factory] at org.jboss.deployment.J2eeDeployer.startApplication(J2
      eeDeployer.java:415)
      [Container factory] at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer
      .java:178)
      [Container factory] at java.lang.reflect.Method.invoke(Native Method)
      [Container factory] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1628)
      [Container factory] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1523)
      [Container factory] at org.jboss.ejb.AutoDeployer.deploy(AutoDeployer.java:3
      58)
      [Container factory] at org.jboss.ejb.AutoDeployer.run(AutoDeployer.java:221)

      [Container factory] at java.lang.Thread.run(Thread.java:484)
      [J2EE Deployer Default] Starting Allocation.jar failed!
      [Auto deploy] org.jboss.ejb.DeploymentException: Could not deploy file:/C:/JBoss
      -2.2.2/tmp/deploy/Default/Allocation.jar, Cause:java.lang.ClassNotFoundException
      : org.jboss.docs.allocation.AllocationHome
      [Auto deploy] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:3
      65)
      [Auto deploy] at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:2
      75)
      [Auto deploy] at java.lang.reflect.Method.invoke(Native Method)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [Auto deploy] at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeploy
      er.java:415)
      [Auto deploy] at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:17
      8)
      [Auto deploy] at java.lang.reflect.Method.invoke(Native Method)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [Auto deploy] at org.jboss.ejb.AutoDeployer.deploy(AutoDeployer.java:358)
      [Auto deploy] at org.jboss.ejb.AutoDeployer.run(AutoDeployer.java:221)
      [Auto deploy] at java.lang.Thread.run(Thread.java:484)
      [J2EE Deployer Default] Module Allocation.jar is not running
      [J2EE Deployer Default] Destroying application Allocation.jar
      [Auto deploy] Deployment failed:file:/C:/JBoss-2.2.2/deploy/Allocation.jar
      [Auto deploy] org.jboss.deployment.J2eeDeploymentException: Error while starting
      Allocation.jar: Could not deploy file:/C:/JBoss-2.2.2/tmp/deploy/Default/Alloca
      tion.jar
      [Auto deploy] at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeploy
      er.java:442)
      [Auto deploy] at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:17
      8)
      [Auto deploy] at java.lang.reflect.Method.invoke(Native Method)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [Auto deploy] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [Auto deploy] at org.jboss.ejb.AutoDeployer.deploy(AutoDeployer.java:358)
      [Auto deploy] at org.jboss.ejb.AutoDeployer.run(AutoDeployer.java:221)
      [Auto deploy] at java.lang.Thread.run(Thread.java:484)