14 Replies Latest reply on Mar 28, 2002 11:18 AM by Dennis Muhlestein

    The problem of the business method inside CMP2.0 Bean

    billhuangyu Newbie

      I currently use JBoss3.0.0 Beta2(07/03/2002 CVS) with mysql, I can successfully create entity bean and the record inside the mysql. But when I call the business method to transfer the amount from one entity bean to another, and I got the exception like below, anyone can help? Thank you. The code about my programme and configuration list as below.

      --------------------------------Distributor.java

      package examples.distributor;

      import java.rmi.RemoteException;
      import javax.ejb.EJBObject;
      import javax.ejb.CreateException;
      import javax.ejb.FinderException;

      public interface Distributor extends EJBObject {

      public void addOffice(String location, String[] salesReps,
      double[] salesVolume)
      throws CreateException, RemoteException;


      public void correctTransferOfSalesReps(String originalLocation,
      String newLocation, double minVolume)
      throws RemoteException, FinderException;
      }

      ------------------------------------------------DistributorHome.java

      package examples.distributor;

      import java.rmi.RemoteException;
      import javax.ejb.EJBHome;
      import javax.ejb.FinderException;
      import javax.ejb.CreateException;

      public interface DistributorHome extends EJBHome {

      public Distributor create(String distributorName)
      throws CreateException, RemoteException;

      public Distributor findByPrimaryKey(String distributorName)
      throws FinderException, RemoteException;
      }

      --------------------------------------------------DistributorBean.java

      package examples.distributor;

      import java.util.Collection;
      import java.util.Iterator;
      import javax.naming.InitialContext;
      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      import javax.ejb.CreateException;
      import javax.ejb.FinderException;
      import javax.ejb.EJBException;

      public abstract class DistributorBean implements EntityBean {

      public abstract String getDistributorName();
      public abstract void setDistributorName(String distributorName);

      public abstract Collection getOffices();
      public abstract void setOffices(Collection offices);
      public abstract SalesOfficeLocal ejbSelectSalesOffice(
      String distributorName, String salesRepName) throws FinderException;
      public void addOffice(String location, String[] salesReps,
      double[] salesVolume) throws CreateException {

      SalesOfficeLocal salesOffice = createOffice(location);
      for (int iter=0; iter<salesReps.length; iter++) {
      SalesRepLocal salesRep = createSalesRep(salesReps[iter],
      salesVolume[iter]);
      salesOffice.getSalesReps().add(salesRep);
      }
      getOffices().add(salesOffice);
      }
      public void correctTransferOfSalesReps(String originalLocationName,
      String newLocationName, double minVolume)
      throws FinderException {

      SalesOfficeLocal originalLocation = ejbSelectSalesOffice(
      getDistributorName(), originalLocationName);
      SalesOfficeLocal newLocation = ejbSelectSalesOffice(
      getDistributorName(), newLocationName);

      Iterator iterRepsOriginal = originalLocation.getSalesReps().iterator();
      while (iterRepsOriginal.hasNext()) {
      SalesRepLocal rep = (SalesRepLocal) iterRepsOriginal.next();
      if (rep.getSalesVolume() >= minVolume) {
      iterRepsOriginal.remove();
      newLocation.getSalesReps().add(rep);
      }
      }
      }
      public SalesOfficeLocal createOffice(String location)
      throws CreateException {

      try {
      InitialContext initial = new InitialContext();
      SalesOfficeLocalHome home = (SalesOfficeLocalHome)
      initial.lookup("ejb/SalesOfficeEJB");
      return home.create(location);
      } catch (Exception e) {
      throw new javax.ejb.EJBException(e);
      }
      }
      public SalesRepLocal createSalesRep(String repName, double salesVolume)
      throws CreateException {

      try {
      InitialContext initial = new InitialContext();
      SalesRepLocalHome home = (SalesRepLocalHome)
      initial.lookup("ejb/SalesRepEJB");
      return home.create(repName, salesVolume);
      } catch (Exception e) {
      throw new javax.ejb.EJBException(e);
      }
      }

      public String ejbCreate(String distributorName)
      throws CreateException {
      setDistributorName(distributorName);
      return null;
      }

      public void ejbPostCreate(String distributorName)
      throws CreateException {}

      public void ejbActivate() {}
      public void ejbLoad() {}
      public void ejbPassivate() {}
      public void ejbRemove() {}
      public void ejbStore() {}
      public void setEntityContext(EntityContext ctx) {}
      public void unsetEntityContext() {}
      }


      --------------------------------------------------SalesOfficeLocal.java

      package examples.distributor;

      import java.util.Collection;
      import javax.ejb.EJBLocalObject;

      public interface SalesOfficeLocal extends EJBLocalObject {

      public String getLocation();
      public Collection getSalesReps();
      public void setSalesReps(Collection salesReps);
      }


      ----------------------------------------------------------SalesOfficeLocalHome.java
      package examples.distributor;

      import javax.ejb.EJBLocalHome;
      import javax.ejb.FinderException;
      import javax.ejb.CreateException;

      public interface SalesOfficeLocalHome extends EJBLocalHome {

      public SalesOfficeLocal findByPrimaryKey(String location)
      throws FinderException;

      public SalesOfficeLocal create(String location)
      throws CreateException;
      }

      -------------------------------------------------------------SalesOfficeBean.java

      package examples.distributor;

      import java.util.Collection;
      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      import javax.ejb.CreateException;

      public abstract class SalesOfficeBean implements EntityBean {

      public abstract String getLocation();
      public abstract void setLocation(String location);

      public abstract Collection getSalesReps();
      public abstract void setSalesReps(Collection salesReps);

      public String ejbCreate(String location)
      throws CreateException {
      setLocation(location);
      return null;
      }

      public void ejbPostCreate(String location)
      throws CreateException {}

      public void ejbActivate() {}
      public void ejbLoad() {}
      public void ejbPassivate() {}
      public void ejbRemove() {}
      public void ejbStore() {}
      public void setEntityContext(EntityContext ctx) {}
      public void unsetEntityContext() {}

      }

      -----------------------------------------------------------SalesRepLocal.java

      package examples.distributor;

      import javax.ejb.EJBLocalObject;

      public interface SalesRepLocal extends EJBLocalObject {
      public String getRepName();
      public double getSalesVolume();
      public void setSalesVolume(double volume);
      }

      --------------------------------------------------------------------SalesRepLocalHome.java


      package examples.distributor;

      import javax.ejb.EJBLocalHome;
      import javax.ejb.FinderException;
      import javax.ejb.CreateException;

      public interface SalesRepLocalHome extends EJBLocalHome {

      public SalesRepLocal findByPrimaryKey(String name)
      throws FinderException;

      public SalesRepLocal create(String name, double volume)
      throws CreateException;
      }

      ----------------------------------------------------------------SalesRepBean.java


      package examples.distributor;

      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      import javax.ejb.CreateException;

      public abstract class SalesRepBean implements EntityBean {

      public abstract String getRepName();
      public abstract void setRepName(String repName);

      public abstract double getSalesVolume();
      public abstract void setSalesVolume(double volume);

      public String ejbCreate(String repName, double salesVolume)
      throws CreateException {
      setRepName(repName);
      setSalesVolume(salesVolume);
      return null;
      }

      public void ejbPostCreate(String repName, double salesVolume)
      throws CreateException {}

      public void ejbActivate() {}
      public void ejbLoad() {}
      public void ejbPassivate() {}
      public void ejbRemove() {}
      public void ejbStore() {}
      public void setEntityContext(EntityContext ctx) {}
      public void unsetEntityContext() {}
      }


      -------------------------------------------------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>
      <display-name>distributor</display-name>
      <enterprise-beans>

      <display-name>DistributorEJB</display-name>
      <ejb-name>DistributorEJB</ejb-name>
      examples.distributor.DistributorHome
      examples.distributor.Distributor
      <ejb-class>examples.distributor.DistributorBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>DistributorBean</abstract-schema-name>
      <cmp-field>
      <field-name>distributorName</field-name>
      </cmp-field>
      <primkey-field>distributorName</primkey-field>
      <ejb-local-ref>
      <ejb-ref-name>ejb/SalesOfficeEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>examples.distributor.SalesOfficeLocalHome</local-home>
      examples.distributor.SalesOfficeLocal
      <ejb-link>SalesOfficeEJB</ejb-link>
      </ejb-local-ref>
      <ejb-local-ref>
      <ejb-ref-name>ejb/SalesRepEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>examples.distributor.SalesRepLocalHome</local-home>
      examples.distributor.SalesRepLocal
      <ejb-link>SalesRepEJB</ejb-link>
      </ejb-local-ref>


      <query-method>
      <method-name>ejbSelectSalesOffice</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql>SELECT OBJECT(so) FROM DistributorBean db, IN (db.offices) so WHERE db.distributorName = ?1 and so.location = ?2</ejb-ql>



      <display-name>SalesOfficeEJB</display-name>
      <ejb-name>SalesOfficeEJB</ejb-name>
      <local-home>examples.distributor.SalesOfficeLocalHome</local-home>
      examples.distributor.SalesOfficeLocal
      <ejb-class>examples.distributor.SalesOfficeBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>SalesOfficeBean</abstract-schema-name>
      <cmp-field>
      <field-name>location</field-name>
      </cmp-field>
      <primkey-field>location</primkey-field>


      <display-name>SalesRepEJB</display-name>
      <ejb-name>SalesRepEJB</ejb-name>
      <local-home>examples.distributor.SalesRepLocalHome</local-home>
      examples.distributor.SalesRepLocal
      <ejb-class>examples.distributor.SalesRepBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>SalesRepBean</abstract-schema-name>
      <cmp-field>
      <field-name>repName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>salesVolume</field-name>
      </cmp-field>
      <primkey-field>repName</primkey-field>

      </enterprise-beans>

      <ejb-relation>
      <ejb-relation-name>Distributer-SalesOffice</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>DistributorEJB</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>DistributorEJB</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>offices</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>SalesOfficeEJB</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>
      <ejb-relation>
      <ejb-relation-name>SalesOffice-SalesReps</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>SalesOfficeEJB</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>salesReps</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesRepEJB</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>SalesRepEJB</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>

      <assembly-descriptor>
      <container-transaction>

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

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      <container-transaction>

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

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      <container-transaction>

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

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


      ---------------------------------------------------------------jboss.xml

      <?xml version="1.0" encoding="Cp1252"?>

      <enterprise-beans>

      <ejb-name>DistributorEJB</ejb-name>
      <jndi-name>DistributorEJB</jndi-name>


      <ejb-name>SalesOfficeEJB</ejb-name>
      <local-jndi-name>ejb/SalesOfficeEJB</local-jndi-name>


      <ejb-name>SalesRepEJB</ejb-name>
      <local-jndi-name>ejb/SalesRepEJB</local-jndi-name>

      </enterprise-beans>



      -----------------------------------------------------------------jbosscmp-jdbc.xml

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <jbosscmp-jdbc>
      <enterprise-beans>

      <ejb-name>DistributorEJB</ejb-name>
      <table-name>DistributorBean</table-name>
      <cmp-field>
      <field-name>distributorName</field-name>
      <column-name>distributorName</column-name>
      </cmp-field>


      <query-method>
      <method-name>ejbSelectSalesOffice</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>



      <ejb-name>SalesOfficeEJB</ejb-name>
      <table-name>SalesOfficeBean</table-name>
      <cmp-field>
      <field-name>location</field-name>
      <column-name>location</column-name>
      </cmp-field>


      <ejb-name>SalesRepEJB</ejb-name>
      <table-name>SalesRepBean</table-name>
      <cmp-field>
      <field-name>repName</field-name>
      <column-name>repName</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>salesVolume</field-name>
      <column-name>salesVolume</column-name>
      </cmp-field>

      </enterprise-beans>

      <ejb-relation>
      <ejb-relation-name>Distributer-SalesOffice</ejb-relation-name>
      <foreign-key-mapping>
      <ejb-relationship-role>
      <ejb-relationship-role-name>DistributorEJB</ejb-relationship-role-name>
      <foreign-key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
      <foreign-key-fields>
      <foreign-key-field>
      <field-name>distributorName</field-name>
      <column-name>distributorName</column-name>
      </foreign-key-field>
      </foreign-key-fields>
      </ejb-relationship-role>
      </foreign-key-mapping>
      </ejb-relation>
      <ejb-relation>
      <ejb-relation-name>SalesOffice-SalesReps</ejb-relation-name>
      <foreign-key-mapping>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
      <foreign-key-fields/>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>SalesRepEJB</ejb-relationship-role-name>
      <foreign-key-fields>
      <foreign-key-field>
      <field-name>location</field-name>
      <column-name>location</column-name>
      </foreign-key-field>
      </foreign-key-fields>
      </ejb-relationship-role>
      </foreign-key-mapping>
      </ejb-relation>

      </jbosscmp-jdbc>

        • 1. Re: The problem of the business method inside CMP2.0 Bean
          billhuangyu Newbie

          Sorry, I forget to post the exception I got, and the client programme. They list as below.

          -------------Exception I got----------------------
          java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
          java.rmi.ServerException: null
          Embedded Exception
          null; nested exception is:
          javax.ejb.EJBException: null
          Embedded Exception
          null
          java.rmi.ServerException: null
          Embedded Exception
          null; nested exception is:
          javax.ejb.EJBException: null
          Embedded Exception
          null
          javax.ejb.EJBException: null
          Embedded Exception
          null
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
          at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
          at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
          at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
          at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
          at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:74)
          at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:77)
          at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:117)
          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
          at $Proxy1.correctTransferOfSalesReps(Unknown Source)
          at mysqltest.Client.main(Client.java:54)
          java.lang.ArrayIndexOutOfBoundsException
          <<no stack trace available>>


          -----------------------Client.java-----------------


          package mysqltest;


          import examples.distributor.*;
          import javax.naming.InitialContext;
          import javax.rmi.PortableRemoteObject;

          public class Client {

          private static final String[] albanyReps = new String[] {
          "Kaylie", "Molly", "Ryan"
          };

          private static final double[] albanyVolume = new double[] {
          55000.0, 57000.0, 48000.0
          };

          private static final String[] washingtonReps = new String[] {
          "Lauren", "Brian", "Nick"
          };

          private static final double[] washingtonVolume = new double[] {
          59000.0, 60000.0, 44500.0
          };

          public static void main(String[] args) {
          try {
          InitialContext initial = new InitialContext();


          DistributorHome distributorHome = (DistributorHome)
          PortableRemoteObject.narrow(initial.lookup("DistributorEJB"), DistributorHome.class);

          Distributor distributor = distributorHome.create("East Coast Computers");
          distributor.addOffice("Albany", albanyReps, albanyVolume);
          distributor.addOffice("Washington", washingtonReps, washingtonVolume);


          distributor.correctTransferOfSalesReps("Washington", "Albany", 50000.0);
          } catch (Exception e) {
          e.printStackTrace();
          }
          }
          }

          • 2. Re: The problem of the business method inside CMP2.0 Bean
            Marcus Brito Novice

            This exception is thrown on the server side so you won't be able to get it's stack trace on the client side.

            Take a look at the JBoss log ($JBOSS_HOME/server/default/log/server.log) and look for the complete stack trace there. If you can't figure out the problem alone, post it here so we may try to help you.

            • 3. Re: The problem of the business method inside CMP2.0 Bean
              billhuangyu Newbie

              Actually I cannot find any exception in my log file. Part of the log file information is showed as below. Is there some parameter I have not set in my configuration?
              Hope the information will help you to figure out what happened.

              2002-03-08 18:27:28,373 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:28,373 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:28,373 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:28,463 DEBUG [org.jboss.ejb.EJBDeployer] Verifying file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:28,473 INFO [STDOUT] WARNING: EJBVerifier2.0 Entity verification not implemented
              2002-03-08 18:27:28,473 INFO [STDOUT] WARNING: EJBVerifier2.0 Entity verification not implemented
              2002-03-08 18:27:28,473 INFO [STDOUT] WARNING: EJBVerifier2.0 Entity verification not implemented
              2002-03-08 18:27:28,473 DEBUG [org.jboss.ejb.EJBDeployer] Deploying: file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:28,473 INFO [org.jboss.ejb.EjbModule] Creating
              2002-03-08 18:27:28,473 DEBUG [org.jboss.ejb.EjbModule] Application.start(), begin
              2002-03-08 18:27:28,473 DEBUG [org.jboss.management.j2ee.EjbModule] EjbModule.create(), server name: J2EEServer=Single
              2002-03-08 18:27:28,473 DEBUG [org.jboss.management.j2ee.J2EEApplication] Create J2EE Application, name: distributor.jar, server: jboss.management.single:J2EEDomain=Manager,name=Single,type=J2EEServer
              2002-03-08 18:27:28,483 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=distributor.jar,type=J2EEApplication
              2002-03-08 18:27:28,483 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,name=Single,type=J2EEServer
              2002-03-08 18:27:28,483 DEBUG [org.jboss.management.j2ee.J2EEDeployedObject] File: file:/G:/jboss-3.0.0beta2/server/default/tmp/deploy/G/jboss-3.0.0beta2/server/default/deploy/distributor.jar/58.distributor.jar, descriptor: META-INF/ejb-jar.xml
              2002-03-08 18:27:28,493 DEBUG [org.jboss.management.j2ee.EjbModule] Create EJB-Module, name: distributor.jar, application: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=distributor.jar,type=J2EEApplication, dd: <?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>
              <display-name>distributor</display-name>
              <enterprise-beans>

              <display-name>DistributorEJB</display-name>
              <ejb-name>DistributorEJB</ejb-name>
              examples.distributor.DistributorHome
              examples.distributor.Distributor
              <ejb-class>examples.distributor.DistributorBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              True
              <cmp-version>2.x</cmp-version>
              <abstract-schema-name>DistributorBean</abstract-schema-name>
              <cmp-field>
              <field-name>distributorName</field-name>
              </cmp-field>
              <primkey-field>distributorName</primkey-field>
              <ejb-local-ref>
              <ejb-ref-name>ejb/SalesOfficeEJB</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>examples.distributor.SalesOfficeLocalHome</local-home>
              examples.distributor.SalesOfficeLocal
              <ejb-link>SalesOfficeEJB</ejb-link>
              </ejb-local-ref>
              <ejb-local-ref>
              <ejb-ref-name>ejb/SalesRepEJB</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>examples.distributor.SalesRepLocalHome</local-home>
              examples.distributor.SalesRepLocal
              <ejb-link>SalesRepEJB</ejb-link>
              </ejb-local-ref>


              <query-method>
              <method-name>ejbSelectSalesOffice</method-name>
              <method-params>
              <method-param>java.lang.String</method-param>
              <method-param>java.lang.String</method-param>
              </method-params>
              </query-method>
              <result-type-mapping>Local</result-type-mapping>
              <ejb-ql>SELECT OBJECT(so) FROM DistributorBean db, IN (db.offices) so WHERE db.distributorName = ?1 and so.location = ?2</ejb-ql>



              <display-name>SalesOfficeEJB</display-name>
              <ejb-name>SalesOfficeEJB</ejb-name>
              <local-home>examples.distributor.SalesOfficeLocalHome</local-home>
              examples.distributor.SalesOfficeLocal
              <ejb-class>examples.distributor.SalesOfficeBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              True
              <cmp-version>2.x</cmp-version>
              <abstract-schema-name>SalesOfficeBean</abstract-schema-name>
              <cmp-field>
              <field-name>location</field-name>
              </cmp-field>
              <primkey-field>location</primkey-field>


              <display-name>SalesRepEJB</display-name>
              <ejb-name>SalesRepEJB</ejb-name>
              <local-home>examples.distributor.SalesRepLocalHome</local-home>
              examples.distributor.SalesRepLocal
              <ejb-class>examples.distributor.SalesRepBean</ejb-class>
              <persistence-type>Container</persistence-type>
              <prim-key-class>java.lang.String</prim-key-class>
              True
              <cmp-version>2.x</cmp-version>
              <abstract-schema-name>SalesRepBean</abstract-schema-name>
              <cmp-field>
              <field-name>repName</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>salesVolume</field-name>
              </cmp-field>
              <primkey-field>repName</primkey-field>

              </enterprise-beans>

              <ejb-relation>
              <ejb-relation-name>Distributer-SalesOffice</ejb-relation-name>
              <ejb-relationship-role>
              <ejb-relationship-role-name>DistributorEJB</ejb-relationship-role-name>
              One
              <relationship-role-source>
              <ejb-name>DistributorEJB</ejb-name>
              </relationship-role-source>
              <cmr-field>
              <cmr-field-name>offices</cmr-field-name>
              <cmr-field-type>java.util.Collection</cmr-field-type>
              </cmr-field>
              </ejb-relationship-role>
              <ejb-relationship-role>
              <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
              Many
              <relationship-role-source>
              <ejb-name>SalesOfficeEJB</ejb-name>
              </relationship-role-source>
              </ejb-relationship-role>
              </ejb-relation>
              <ejb-relation>
              <ejb-relation-name>SalesOffice-SalesReps</ejb-relation-name>
              <ejb-relationship-role>
              <ejb-relationship-role-name>SalesOfficeEJB</ejb-relationship-role-name>
              One
              <relationship-role-source>
              <ejb-name>SalesOfficeEJB</ejb-name>
              </relationship-role-source>
              <cmr-field>
              <cmr-field-name>salesReps</cmr-field-name>
              <cmr-field-type>java.util.Collection</cmr-field-type>
              </cmr-field>
              </ejb-relationship-role>
              <ejb-relationship-role>
              <ejb-relationship-role-name>SalesRepEJB</ejb-relationship-role-name>
              Many
              <relationship-role-source>
              <ejb-name>SalesRepEJB</ejb-name>
              </relationship-role-source>
              </ejb-relationship-role>
              </ejb-relation>

              <assembly-descriptor>
              <container-transaction>

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

              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>

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

              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>

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

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

              2002-03-08 18:27:28,493 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,name=distributor.jar,J2EEServer=Single,J2EEApplication=distributor.jar,type=EjbModule
              2002-03-08 18:27:28,493 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=distributor.jar,type=J2EEApplication
              2002-03-08 18:27:28,493 INFO [org.jboss.ejb.EjbModule] Deploying DistributorEJB
              2002-03-08 18:27:28,673 INFO [org.jboss.ejb.EjbModule] Deploying SalesOfficeEJB
              2002-03-08 18:27:28,673 INFO [org.jboss.ejb.EjbModule] Deploying SalesRepEJB
              2002-03-08 18:27:28,733 DEBUG [org.jboss.ejb.EntityContainer] Begin java:comp/env for EJB: SalesRepEJB
              2002-03-08 18:27:28,733 DEBUG [org.jboss.ejb.EntityContainer] TCL: java.net.URLClassLoader@f9a32
              2002-03-08 18:27:28,743 DEBUG [org.jboss.ejb.EntityContainer] End java:comp/env for EJB: SalesRepEJB
              2002-03-08 18:27:28,753 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.SalesRepEJB] Initializing CMP plugin for SalesRepEJB
              2002-03-08 18:27:28,854 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.SalesRepEJB] Loading standardjbosscmp-jdbc.xml : file:/G:/jboss-3.0.0beta2/server/default/conf/standardjbosscmp-jdbc.xml
              2002-03-08 18:27:28,954 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.SalesRepEJB] jar:file:/G:/jboss-3.0.0beta2/server/default/tmp/deploy/G/jboss-3.0.0beta2/server/default/deploy/distributor.jar/58.distributor.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
              2002-03-08 18:27:30,496 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Entity Exists SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:27:30,496 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Insert Entity SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:27:30,506 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.SalesRepEJB] Remove SQL: DELETE FROM SalesRepBean WHERE repName=?
              2002-03-08 18:27:30,546 DEBUG [org.jboss.ejb.EjbModule] Application.create(), create JSR-77 EJB-Component
              2002-03-08 18:27:30,596 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=SalesRepEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,596 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,name=distributor.jar,J2EEServer=Single,J2EEApplication=distributor.jar,type=EjbModule
              2002-03-08 18:27:30,596 DEBUG [org.jboss.ejb.EjbModule] Application.start(), EJB: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=SalesRepEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,596 DEBUG [org.jboss.ejb.EntityContainer] Begin java:comp/env for EJB: SalesOfficeEJB
              2002-03-08 18:27:30,596 DEBUG [org.jboss.ejb.EntityContainer] TCL: java.net.URLClassLoader@46f734
              2002-03-08 18:27:30,606 DEBUG [org.jboss.ejb.EntityContainer] End java:comp/env for EJB: SalesOfficeEJB
              2002-03-08 18:27:30,606 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.SalesOfficeEJB] Initializing CMP plugin for SalesOfficeEJB
              2002-03-08 18:27:30,606 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Entity Exists SQL: SELECT COUNT(*) FROM SalesOfficeBean WHERE location=?
              2002-03-08 18:27:30,606 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Insert Entity SQL: INSERT INTO SalesOfficeBean (location, DistributorEJB_offices) VALUES (?, ?)
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.SalesOfficeEJB] Remove SQL: DELETE FROM SalesOfficeBean WHERE location=?
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EjbModule] Application.create(), create JSR-77 EJB-Component
              2002-03-08 18:27:30,616 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=SalesOfficeEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,616 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,name=distributor.jar,J2EEServer=Single,J2EEApplication=distributor.jar,type=EjbModule
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EjbModule] Application.start(), EJB: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=SalesOfficeEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] Begin java:comp/env for EJB: DistributorEJB
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] TCL: java.net.URLClassLoader@295fe8
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] Binding an EJBLocalReference ejb/SalesRepEJB
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] Binding ejb/SalesRepEJB to bean source: SalesRepEJB
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] Binding an EJBLocalReference ejb/SalesOfficeEJB
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] Binding ejb/SalesOfficeEJB to bean source: SalesOfficeEJB
              2002-03-08 18:27:30,616 DEBUG [org.jboss.ejb.EntityContainer] End java:comp/env for EJB: DistributorEJB
              2002-03-08 18:27:30,626 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Bound jmxName=jboss.j2ee:service=EJB,jndiName=DistributorEJB, hash=1252081261into Registry
              2002-03-08 18:27:30,626 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Proxy Factory for DistributorEJB initialized
              2002-03-08 18:27:30,626 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.DistributorEJB] Initializing CMP plugin for DistributorEJB
              2002-03-08 18:27:30,636 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Entity Exists SQL: SELECT COUNT(*) FROM DistributorBean WHERE distributorName=?
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Insert Entity SQL: INSERT INTO DistributorBean (distributorName) VALUES (?)
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.DistributorEJB] Remove SQL: DELETE FROM DistributorBean WHERE distributorName=?
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.EjbModule] Application.create(), create JSR-77 EJB-Component
              2002-03-08 18:27:30,646 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=DistributorEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,646 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,name=distributor.jar,J2EEServer=Single,J2EEApplication=distributor.jar,type=EjbModule
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.EjbModule] Application.start(), EJB: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=DistributorEJB,J2EEApplication=distributor.jar,EjbModule=distributor.jar,type=EntityBean
              2002-03-08 18:27:30,646 INFO [org.jboss.ejb.EjbModule] Created
              2002-03-08 18:27:30,646 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying distributor.jar
              2002-03-08 18:27:30,646 DEBUG [org.jboss.deployment.MainDeployer] start step for deployment file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.EJBDeployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@af8a9940{ url=file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar }, short name: distributor.jar, parent short name: null
              2002-03-08 18:27:30,646 INFO [org.jboss.ejb.EjbModule] Starting
              2002-03-08 18:27:30,646 DEBUG [org.jboss.ejb.EjbModule] Application.start(), start container: org.jboss.ejb.EntityContainer@3fed5a
              2002-03-08 18:27:30,656 DEBUG [org.jboss.ejb.plugins.local.BaseLocalContainerInvoker] Bound Local SalesRepEJB to ejb/SalesRepEJB
              2002-03-08 18:27:30,666 INFO [org.jboss.ejb.plugins.EnterpriseContextCachePolicy] Cache policy scheduler started
              2002-03-08 18:27:31,007 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesRepEJB] Executing SQL: CREATE TABLE SalesRepBean (repName VARCHAR(255) BINARY NOT NULL, salesVolume DOUBLE NOT NULL, SalesOfficeEJB_salesReps VARCHAR(255) BINARY)
              2002-03-08 18:27:31,017 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesRepEJB] Created table 'SalesRepBean' successfully.
              2002-03-08 18:27:31,037 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.SalesRepEJB.findByPrimaryKey] SQL: SELECT repName FROM SalesRepBean WHERE repName=?
              2002-03-08 18:27:31,037 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.SalesRepEJB] Added findByPrimaryKey query command for local home interface
              2002-03-08 18:27:31,037 DEBUG [org.jboss.ejb.EjbModule] Application.start(), start container: org.jboss.ejb.EntityContainer@3914b3
              2002-03-08 18:27:31,047 DEBUG [org.jboss.ejb.plugins.local.BaseLocalContainerInvoker] Bound Local SalesOfficeEJB to ejb/SalesOfficeEJB
              2002-03-08 18:27:31,047 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesOfficeEJB] Executing SQL: CREATE TABLE SalesOfficeBean (location VARCHAR(255) BINARY NOT NULL, DistributorEJB_offices VARCHAR(255) BINARY)
              2002-03-08 18:27:31,067 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesOfficeEJB] Created table 'SalesOfficeBean' successfully.
              2002-03-08 18:27:31,067 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesOfficeEJB] Executing SQL: ALTER TABLE SalesRepBean ADD CONSTRAINT fk_SalesRepBean_SalesOfficeEJB_salesReps FOREIGN KEY (SalesOfficeEJB_salesReps) REFERENCES SalesOfficeBean (location)
              2002-03-08 18:27:31,087 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.SalesOfficeEJB] Added foreign key constriant to table 'SalesRepBean
              2002-03-08 18:27:31,087 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.SalesOfficeEJB.findByPrimaryKey] SQL: SELECT location FROM SalesOfficeBean WHERE location=?
              2002-03-08 18:27:31,087 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.SalesOfficeEJB] Added findByPrimaryKey query command for local home interface
              2002-03-08 18:27:31,087 DEBUG [org.jboss.ejb.EjbModule] Application.start(), start container: org.jboss.ejb.EntityContainer@2674b
              2002-03-08 18:27:31,107 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Bound DistributorEJB to DistributorEJB
              2002-03-08 18:27:31,107 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DistributorEJB] Executing SQL: CREATE TABLE DistributorBean (distributorName VARCHAR(255) BINARY NOT NULL)
              2002-03-08 18:27:31,117 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DistributorEJB] Created table 'DistributorBean' successfully.
              2002-03-08 18:27:31,117 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DistributorEJB] Executing SQL: ALTER TABLE SalesOfficeBean ADD CONSTRAINT fk_SalesOfficeBean_DistributorEJB_offices FOREIGN KEY (DistributorEJB_offices) REFERENCES DistributorBean (distributorName)
              2002-03-08 18:27:31,137 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.DistributorEJB] Added foreign key constriant to table 'SalesOfficeBean
              2002-03-08 18:27:31,147 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.DistributorEJB.findByPrimaryKey] SQL: SELECT distributorName FROM DistributorBean WHERE distributorName=?
              2002-03-08 18:27:31,147 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.DistributorEJB] Added findByPrimaryKey query command for home interface
              2002-03-08 18:27:31,147 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.DistributorEJB.ejbSelectSalesOffice] EJB-QL: SELECT OBJECT(so) FROM DistributorBean db, IN (db.offices) so WHERE db.distributorName = ?1 and so.location = ?2
              2002-03-08 18:27:31,317 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.DistributorEJB.ejbSelectSalesOffice] SQL:
              SELECT t0_so.location FROM DistributorBean t1_db, SalesOfficeBean t0_so WHERE t1_db.distributorName = ? AND t0_so.location = ? AND (t1_db.distributorName=t0_so.DistributorEJB_offices)
              2002-03-08 18:27:31,317 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.DistributorEJB.ejbSelectSalesOffice] SQL: SELECT t0_so.location FROM DistributorBean t1_db, SalesOfficeBean t0_so WHERE t1_db.distributorName = ? AND t0_so.location = ? AND (t1_db.distributorName=t0_so.DistributorEJB_offices)
              2002-03-08 18:27:31,317 INFO [org.jboss.ejb.EjbModule] Started
              2002-03-08 18:27:31,317 DEBUG [org.jboss.ejb.EJBDeployer] Deployed: file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:27:31,317 DEBUG [org.jboss.deployment.MainDeployer] Final (start) deployment step successfully completed on package: distributor.jar
              2002-03-08 18:27:31,317 INFO [org.jboss.deployment.MainDeployer] Successfully completed deployment of package: file:/G:/jboss-3.0.0beta2/server/default/deploy/distributor.jar
              2002-03-08 18:28:22,090 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Create: pk=East Coast Computers
              2002-03-08 18:28:22,100 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Executing SQL: SELECT COUNT(*) FROM DistributorBean WHERE distributorName=?
              2002-03-08 18:28:22,140 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Executing SQL: INSERT INTO DistributorBean (distributorName) VALUES (?)
              2002-03-08 18:28:22,140 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.DistributorEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,220 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Create: pk=Albany
              2002-03-08 18:28:22,220 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Executing SQL: SELECT COUNT(*) FROM SalesOfficeBean WHERE location=?
              2002-03-08 18:28:22,220 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Executing SQL: INSERT INTO SalesOfficeBean (location, DistributorEJB_offices) VALUES (?, ?)
              2002-03-08 18:28:22,220 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,230 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Kaylie
              2002-03-08 18:28:22,230 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,250 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,250 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,270 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Molly
              2002-03-08 18:28:22,270 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,270 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,270 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,270 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Ryan
              2002-03-08 18:28:22,280 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,280 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,280 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,290 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.DistributorEJB] Executing SQL: SELECT location FROM SalesOfficeBean WHERE (DistributorEJB_offices=?)
              2002-03-08 18:28:22,290 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesOfficeEJB] Executing SQL: UPDATE SalesOfficeBean SET DistributorEJB_offices=? WHERE location=?
              2002-03-08 18:28:22,300 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesOfficeEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,300 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,300 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,310 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,310 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,320 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,320 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,330 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Create: pk=Washington
              2002-03-08 18:28:22,330 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Executing SQL: SELECT COUNT(*) FROM SalesOfficeBean WHERE location=?
              2002-03-08 18:28:22,330 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Executing SQL: INSERT INTO SalesOfficeBean (location, DistributorEJB_offices) VALUES (?, ?)
              2002-03-08 18:28:22,330 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesOfficeEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,330 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Lauren
              2002-03-08 18:28:22,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Brian
              2002-03-08 18:28:22,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,351 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,351 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,351 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: pk=Nick
              2002-03-08 18:28:22,351 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: SELECT COUNT(*) FROM SalesRepBean WHERE repName=?
              2002-03-08 18:28:22,351 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Executing SQL: INSERT INTO SalesRepBean (repName, salesVolume, SalesOfficeEJB_salesReps) VALUES (?, ?, ?)
              2002-03-08 18:28:22,361 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,361 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.DistributorEJB] Executing SQL: SELECT location FROM SalesOfficeBean WHERE (DistributorEJB_offices=?)
              2002-03-08 18:28:22,371 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesOfficeEJB] Executing SQL: UPDATE SalesOfficeBean SET DistributorEJB_offices=? WHERE location=?
              2002-03-08 18:28:22,371 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesOfficeEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,371 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,371 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,381 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,381 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1
              2002-03-08 18:28:22,381 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Executing SQL: UPDATE SalesRepBean SET SalesOfficeEJB_salesReps=? WHERE repName=?
              2002-03-08 18:28:22,381 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.SalesRepEJB] Create: Rows affected = 1

              • 4. Re: The problem of the business method inside CMP2.0 Bean
                billhuangyu Newbie

                This is all the log information after I deployed the jar and run the client programme.

                • 5. Re: The problem of the business method inside CMP2.0 Bean
                  Adrian Brock Master

                  Hi,

                  There was a major modification to the client side
                  processing and the proxy compiler got reimplemented on
                  7/03/2002 (yesterday).

                  You might want to step back to 6/03/2002?

                  Regards,
                  Adrian

                  • 6. Re: The problem of the business method inside CMP2.0 Bean
                    billhuangyu Newbie

                    I have try the 6/03/02 copy, I get another exception in the client side. Do you have any good suggestion. By the way, do you know when the client side modification will finish?

                    -------------The new exception is show as below ---------

                    If I run the client side in same machine as jboss server, I got exception like below.

                    java.lang.NoClassDefFoundError: org/jboss/security/SecurityAssociation

                    at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:132)

                    at org.jboss.proxy.ejb.GenericProxy.invoke(GenericProxy.java:182)

                    at org.jboss.proxy.ejb.HomeProxy.invoke(HomeProxy.java:191)

                    at $Proxy1.create(Unknown Source)

                    at mysqltest.Client.main(Client.java:42)

                    Exception in thread "main"

                    If I run it in another computer, I got exception like below:

                    javax.naming.ServiceUnavailableException: Connection refused: connect. Root exception is java.net.ConnectException: Connection refused: connect
                    at java.net.PlainSocketImpl.socketConnect(Native Method)
                    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
                    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
                    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
                    at java.net.Socket.(Socket.java:273)
                    at java.net.Socket.(Socket.java:100)
                    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:102)
                    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:776)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:340)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
                    at javax.naming.InitialContext.lookup(InitialContext.java:350)
                    at mysqltest.Client.main(Client.java:39)


                    PS: it is something about the security setting, how can I overcome this exception.

                    Thank you.

                    • 7. Re: The problem of the business method inside CMP2.0 Bean
                      billhuangyu Newbie

                      When I click on the error in jbuilder 6.0, it give me the JRMPInvokerProxy file below, I don't know anything about these code. It might help you to identify what problem I have.

                      // JBuilder API Decompiler stub source generated from class file
                      // 2002-3-8
                      // -- implementation of methods is not available

                      package org.jboss.invocation.jrmp.interfaces;

                      // Imports
                      import org.jboss.invocation.Invocation;
                      import org.jboss.tm.TransactionPropagationContextFactory;
                      import javax.transaction.SystemException;
                      import java.lang.ClassNotFoundException;
                      import java.io.ObjectOutput;
                      import org.jboss.invocation.Invoker;
                      import java.io.Externalizable;
                      import java.io.IOException;
                      import java.lang.Object;
                      import java.io.ObjectInput;
                      import java.lang.String;
                      import java.lang.Exception;

                      public class JRMPInvokerProxy implements Invoker, Externalizable {

                      // Fields
                      private long containerStartup;
                      protected Invoker remoteInvoker;
                      protected static Invoker localInvoker;
                      protected static TransactionPropagationContextFactory tpcFactory;

                      // Constructors
                      public JRMPInvokerProxy() { }
                      public JRMPInvokerProxy(Invoker p0) { }

                      // Methods
                      public static Invoker getLocal() { }
                      public static void setLocal(Invoker p0) { }
                      public static void setTPCFactory(TransactionPropagationContextFactory p0) { }
                      public boolean isLocal() { }
                      public String getServerHostName() throws Exception { }
                      public Object getTransactionPropagationContext() throws SystemException { }
                      public Object invoke(Invocation p0) throws Exception { }
                      public void writeExternal(ObjectOutput p0) throws IOException { }
                      public void readExternal(ObjectInput p0) throws IOException, ClassNotFoundException { }
                      static { }
                      }

                      • 8. Re: The problem of the business method inside CMP2.0 Bean
                        Adrian Brock Master

                        Hi,

                        I guess CVS has miss-translated your date.
                        SecurityAssociation is VERY old

                        Try using 2002-03-06 as the date? I don't really use
                        dates in CVS myself, I think that is the correct format?

                        Regards,
                        Adrian

                        • 9. Re: The problem of the business method inside CMP2.0 Bean
                          billhuangyu Newbie

                          I have download the 2002-3-6 CVS copy, after build the software, deploy the jar and run the client, I got the Exception like below. I do not know what to do? Thank you to you help Adrian.


                          javax.naming.CommunicationException: org.jboss.ha.framework.interfaces.HARMIProxy. Root exception is java.lang.ClassNotFoundException: org.jboss.ha.framework.interfaces.HARMIProxy

                          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

                          at java.security.AccessController.doPrivileged(Native Method)

                          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

                          at java.lang.ClassLoader.loadClass(ClassLoader.java:297)

                          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)

                          at java.lang.ClassLoader.loadClass(ClassLoader.java:253)

                          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)

                          at java.lang.Class.forName0(Native Method)

                          at java.lang.Class.forName(Class.java:195)

                          at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:183)

                          at java.io.ObjectInputStream.inputProxyClassDescriptor(ObjectInputStream.java:982)

                          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)

                          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)

                          at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)

                          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)

                          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)

                          at java.rmi.MarshalledObject.get(MarshalledObject.java:138)

                          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:128)

                          at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:832)

                          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:890)

                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:356)

                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)

                          at javax.naming.InitialContext.lookup(InitialContext.java:350)

                          at mysqltest.Client.main(Client.java:39)

                          • 10. Re: The problem of the business method inside CMP2.0 Bean
                            Adrian Brock Master

                            That is something related to clustering.
                            You might want to ask in that forum. I haven't seen that
                            error before and don't know what is wrong.

                            Regards,
                            Adrian

                            • 11. Re: The problem of the business method inside CMP2.0 Bean
                              billhuangyu Newbie

                              Do you know when the stable version will be released, I try to find a stable version of beta2, but I failed. And I also try to put the jar package into alpha version, it also generate exception and said that the jar file was not successful deployed. But if I try to run it with Sun J2EE very thing is find. I do want to use JBoss as my appliction server. Do you know any stable version beta that I can find in the CVS. Thank you for your help.

                              • 12. Re: The problem of the business method inside CMP2.0 Bean
                                Adrian Brock Master

                                Hi,

                                I saw somebody fixed a problem with CMP this evening,
                                but there is still a problem with the new proxy compiler.

                                I have a very basic understanding of CMP, but I've never
                                used it so I can't really help you on that part.

                                The only thing I can suggest is get latest CVS,
                                and report your error on sourceforge as a bug.
                                That way all developers will receive a copy of the
                                problem in their e-mail. One of the developers might
                                recognise the problem?

                                3.0final will be release when it is stable by definition.
                                I think we are close to the feature set for 3.0 it is
                                now just a case of getting all the bugs out. ;-)

                                Regards,
                                Adrian

                                • 13. Re: The problem of the business method inside CMP2.0 Bean
                                  Dennis Muhlestein Newbie

                                  I have a very similar Error on the client side but it is a NullPointerException instead of ArrayOutOfBounds.

                                  JBoss is not printing any exception information. It's log looks roughly like..

                                  ..Activated Bean
                                  ..Found Bean
                                  ..Loaded Bean

                                  Then nothing.

                                  Here is part of the client's stack trace.

                                  java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
                                  java.rmi.ServerException: null
                                  Embedded Exception
                                  null; nested exception is:
                                  javax.ejb.EJBException: null
                                  Embedded Exception
                                  null
                                  java.rmi.ServerException: null
                                  Embedded Exception
                                  null; nested exception is:
                                  javax.ejb.EJBException: null
                                  Embedded Exception
                                  null
                                  javax.ejb.EJBException: null
                                  Embedded Exception
                                  null
                                  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
                                  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
                                  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
                                  at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
                                  at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
                                  at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
                                  at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
                                  at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
                                  at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
                                  at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
                                  at $Proxy7.getUsername(Unknown Source)

                                  etc..

                                  I'm simply calling a getter method. I have print logic in the ejb side to say the method gets called but it doesn't get called. Same exception occurs on any of the business methods. If I call getPrimaryKey on the Remote Interface, I get the correct key back.

                                  I can't figure out where The nullpointer exception is coming from. Any suggestions. I think this problem is releated to the original post.

                                  -Thanks in advance.

                                  • 14. Re: The problem of the business method inside CMP2.0 Bean
                                    Dennis Muhlestein Newbie

                                    Fixed it.

                                    This is a very interesting problem. My ejbLoad method didn't ever return. It was trying to release a resource. The client then tried to access a business method.

                                    Very hard to debug but now I know what to look for.