5 Replies Latest reply on Feb 19, 2002 10:01 AM by Alireza BANAEI

    CMP 2.0 issue with EJBLocalObject in JBoss 3.0 alpha

    ppetit Newbie

      I try to deploy an Entity bean conforming to EJB 2.0 in JBoss 3.0 alpha and get this error message at deployment time :

      org.jboss.ejb.DeploymentException: Could not find matching method for public abstract void javax.ejb.EJBLocalObject.remo
      ve() throws javax.ejb.RemoveException,javax.ejb.EJBException, Cause: java.lang.NoSuchMethodException

      here is snippet of code :
      public abstract class Sejour_EBean implements EntityBean
      {
      // Log4j - Define a static category variable so that it references the
      static Category cat = Category.getInstance(Sejour_EBean.class);
      transient private EntityContext ctx;

      public Sejour_EBean(){}

      // container-managed persistent fields
      public abstract Integer getId();
      public abstract void setId( Integer _Id );
      ...
      // EJB required methods __________________________________________________________
      public void setEntityContext(EntityContext ctx) { this.ctx = ctx; }

      public void unsetEntityContext() { ctx = null; }
      public Integer ejbCreate( Integer Id )
      {
      cat.info("ejbCreate() called");
      setId( Id );
      return Id;
      }
      public void ejbPostCreate()
      {
      cat.info("ejbPostCreate() called");
      }
      public void ejbActivate()
      {
      cat.info( "Activate" );
      }
      public void ejbPassivate()
      {
      cat.info( "Passivate" );
      }
      public void ejbLoad()
      {
      cat.info( "Load" );
      }
      public void ejbStore()
      {
      cat.info( "Store" );
      }
      public void ejbRemove()
      {
      cat.info( "Remove" );
      }
      ...

      here is code of the local interface :
      public interface Sejour extends EJBLocalObject
      {
      public Integer getId() throws RemoteException;
      public void setId( Integer _Id ) throws RemoteException;
      ...

      and the local home interface code :
      public interface Sejour_Home extends javax.ejb.EJBLocalHome
      {
      /**
      Create a new Sejour instance
      */
      public Sejour create( Integer Id ) throws RemoteException, CreateException;
      ...

      Am'I missing something or is this a known bug?

        • 1. Re: CMP 2.0 issue with EJBLocalObject in JBoss 3.0 alpha
          Dain Sundstrom Master

          You need to post your ejb-jar.xml file (just the revelent portions), and more of the log message. My guess is that you do not have the correct DOCTYPE in your ejb-jar.xml file. JBossCMP only loads if you use the EJB 2.0 doctype.

          • 2. Re: CMP 2.0 issue with EJBLocalObject in JBoss 3.0 alpha
            ppetit Newbie

            here is the header of my ejb-jar.xml file :

            <?xml version="1.0" encoding="ISO-8859-1"?>

            <!-- Activation CMP 2.0 -->
            <!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>
            ...

            and here is the relevant par of the concerned EJB (the only one extending EJBLocalObject):

            ...
            <!-- ============================================================== -->
            <!-- Entity & Session Bean Sejour -->
            <!-- ============================================================== -->

            Models a Sejour collection
            <ejb-name>SejourCollection</ejb-name>
            fr.ppet.saga.server.services.SejourCollection_Home
            fr.ppet.saga.server.services.SejourCollection
            <ejb-class>fr.ppet.saga.server.services.SejourCollection_SBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <ejb-ref>
            <ejb-ref-name>ejb/Sejour</ejb-ref-name>
            <ejb-ref-type>Entity</ejb-ref-type>
            fr.ppet.saga.server.services.Sejour_Home
            fr.ppet.saga.server.services.Sejour
            <ejb-link>Sejour</ejb-link>
            </ejb-ref>
            <ejb-ref>
            <ejb-ref-name>ejb/SequenceGenFactory</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            fr.ppet.saga.server.util.SequenceGenFactory_Home
            fr.ppet.saga.server.util.SequenceGenFactory
            <ejb-link>SequenceGen</ejb-link>
            </ejb-ref>

            <!-- Declare a security role called ADMINISTRATOR -->
            <security-role>
            <role-name>ADMINISTRATOR</role-name>
            </security-role>



            Cet entity bean sert a la gestion des Sejours et de leurs prestations

            <ejb-name>Sejour</ejb-name>
            fr.ppet.saga.server.services.LocalSejour_Home
            fr.ppet.saga.server.services.Sejour
            <ejb-class>fr.ppet.saga.server.services.Sejour_EBean</ejb-class>
            <persistence-type>Container</persistence-type>

            <!-- new effet inconnu, pour workaround d'un bug de JBoss (marche pas ) -->
            <container-transaction>Required</container-transaction>

            <!-- cmp-version must be '1.x' or '2.x', if specified -->
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>Sejour</abstract-schema-name>

            <prim-key-class>java.lang.Integer</prim-key-class>
            False
            <cmp-field><field-name>Id</field-name></cmp-field>
            <cmp-field><field-name>custId</field-name></cmp-field>
            <cmp-field><field-name>beginDate</field-name></cmp-field>
            <cmp-field><field-name>endDate</field-name></cmp-field>
            <cmp-field><field-name>membershipType</field-name></cmp-field>
            <cmp-field><field-name>membershipTT</field-name></cmp-field>
            <cmp-field><field-name>giftType</field-name></cmp-field>
            <cmp-field><field-name>giftAmount</field-name></cmp-field>
            <cmp-field><field-name>eventLines</field-name></cmp-field>
            <cmp-field><field-name>eventsTT</field-name></cmp-field>
            <cmp-field><field-name>mealLines</field-name></cmp-field>
            <cmp-field><field-name>mealsTT</field-name></cmp-field>
            <cmp-field><field-name>accomodLines</field-name></cmp-field>
            <cmp-field><field-name>accomodTT</field-name></cmp-field>
            <cmp-field><field-name>localeTaxeNb</field-name></cmp-field>
            <cmp-field><field-name>localeTaxeTT</field-name></cmp-field>
            <cmp-field><field-name>othersTT</field-name></cmp-field>
            <cmp-field><field-name>total</field-name></cmp-field>
            <cmp-field><field-name>total2</field-name></cmp-field>
            <cmp-field><field-name>comment</field-name></cmp-field>
            <primkey-field>Id</primkey-field>

            ...

            many thanks for your help and the great job already done !
            Philippe

            • 3. Re: CMP 2.0 issue with EJBLocalObject in JBoss 3.0 alpha
              ppetit Newbie

              here is a zip of the server log file at startup

              regards Philippe

              • 5. Re: CMP 2.0 issue with EJBLocalObject in JBoss 3.0 alpha
                Alireza BANAEI Newbie

                Great! Good for you. I appreciate if you could share your finding with the rest of the JBoss community. I have the same probleme and am looking for a solution.

                Thanks in advance

                Alireza