3 Replies Latest reply on Apr 26, 2004 11:46 AM by sesques

    Local or Remote interface?

    balteo

      Hello,

      I have a EJB called EstablishmentEJB that has a relation with another EJB called CountryEJB. An establishment has a country and a country has several establishments. I have both local and remote interfaces. What's more I have a reference to the CountryEJB in my EstablishmentEJB as follows:

      package com.softwareag.test_guide.establishment;
      
      import java.util.Collection;
      
      import javax.ejb.EntityBean;
      import javax.ejb.EntityContext;
      
      import com.softwareag.test_guide.country.CountryLocal;
      
      /**
       * @author Julien Martin
       */
      public abstract class EstablishmentBean implements EntityBean {
      
       public Integer ejbCreate(
       Integer id,
       String name,
       Collection visitorComments,
       Collection grades,
       CountryLocal country,//here
       Collection categories) {
       setId(id);
       setName(name);
       setVisitorComments(visitorComments);
       setGrades(grades);
       setCountry(country);
       setCategories(categories);
       return null;
       }
       public void ejbPostCreate(
       Integer id,
       String name,
       Collection visitorComments,
       Collection grades,
       CountryLocal country,
       Collection categories) {}
      
       //Persistence fields
       public abstract Integer getId();
       public abstract void setId(Integer id);
       public abstract String getName();
       public abstract void setName(String name);
      
       //Relation fields
       public abstract Collection getVisitorComments();
       public abstract void setVisitorComments(Collection visitorComments);
       public abstract Collection getGrades();
       public abstract void setGrades(Collection grades);
       public abstract CountryLocal getCountry();
       public abstract void setCountry(CountryLocal country);
       public abstract Collection getCategories();
       public abstract void setCategories(Collection categories);
      
       //Callback methods
       public void setEntityContext(EntityContext ec) {}
       public void unsetEntityContext() {}
       public void ejbLoad() {}
       public void ejbStore() {}
       public void ejbActivate() {}
       public void ejbPassivate() {}
       public void ejbRemove() {}
      
      }
      


      My question is: do I need to reference the Local or Remote interface at the line named //here?

      Thanks in advance,

      Julien Martin.

        • 1. Re: Local or Remote interface?
          sesques

          The local interface only for CMR's.
          And you must set the CMR in ejbPostCreate only too.

          Pascal

          • 2. Local or Remote interface?
            balteo

            Hello,
            Thanks for the answer. The class as it is now uses the local interfaces. (note line indicated by //here). However, I still get an "incompatible types" error...
            Can anyone help?
            Julien.

            • 3. Re: Local or Remote interface?
              sesques

              Post the whole error log.
              It could be usefull too if you activate some traces:

              Adds

              <category name="org.jboss.ejb.plugins">
               <priority value="TRACE" class="org.jboss.logging.XLevel"/>
              </category>
              


              in the log4j.xml file (in the conf directory)