2 Replies Latest reply on Jan 10, 2002 2:05 PM by cepage

    ejbCreate<Method> reportin error

    tobyhede

      In my Bean class I have defined the following ejbCreate and ejbPostCreate:

      public abstract class ThingBean
      implements javax.ejb.EntityBean
      {

      . . .

      public Integer ejbCreateWithName(Integer id, String name) throws CreateException
      {
      this.setId(id);
      this.setName(name);
      this.setDateCreated(new Date());
      this.setDateModified(new Date());
      return null;
      }

      public void ejbPostCreateWithName(Integer id, String name) throws CreateException
      {
      }

      . . .

      }

      The RemoteHome interface for the bean has the following defined:

      public IThingRemote createWithName(Integer id, String name) throws RemoteException,CreateException;

      However, when I deploy the bean, I receive an error:

      "Could not find matching method for public.abstract ubik.ejb.thing.interfaces.IThingRemote ubik.ej.thing.interfaces.IThingRemoteHome.createWithName(Integer,String) throws RmemoteException, CreateException"

      Am I missing something in my interface definitions?

      I have defined all other neccessary methods in the ThingBean, when I remove the ejbCreateWithName, the bean is deployed, and I can create and remove without issue.


        • 1. Re: ejbCreate<Method> reportin error
          cepage

          I am encountering the same problem, under the JBoss 3.0 alpha distribution. I have a remote home class defined as follows:

          public interface LocationHome extends javax.ejb.EJBHome {
          public Location createDeductLocation(
          String deductPointNumber,
          Date effectiveFromDate,
          Date effectiveThroughDate,
          String subtypeIndicator) throws CreateException, RemoteException;
          .
          .

          and a Bean defined as follows:

          public abstract class LocationBean implements EntityBean
          {
          public String ejbCreateDeductLocation(
          String deductPointNumber,
          Date effectiveFromDate,
          Date effectiveThroughDate,
          String subtypeIndicator) throws CreateException
          {
          this.setLocationNumber( deductPointNumber );
          this.setSubtypeIndicator( subtypeIndicator );

          return null;
          }
          .
          .

          and my ejb-jar.xml has the appropriate definitions:

          com.duke.realtime.model.location.LocationHome
          com.duke.realtime.model.location.Location
          <local-home>com.duke.realtime.model.location.LocationLocalHome</local-home>
          com.duke.realtime.model.location.LocationLocal
          <ejb-class>com.duke.realtime.model.location.LocationBean</ejb-class>

          The EntityContainer is able to map all of my methods from my Remote interface to my bean, but it throws the following error when it attempts the Home mapping:

          org.jboss.ejb.DeploymentException: Could not find matching method for public abs
          tract com.duke.realtime.model.location.Location com.duke.realtime.model.location
          .LocationHome.createDeductLocation(java.lang.String,java.util.Date,java.util.Dat
          e,java.lang.String) throws javax.ejb.CreateException,java.rmi.RemoteException
          at org.jboss.ejb.EntityContainer.setupHomeMappingImpl(EntityContainer.ja
          va:766)
          at org.jboss.ejb.EntityContainer.setupHomeMapping(EntityContainer.java:7
          79)
          at org.jboss.ejb.EntityContainer.init(EntityContainer.java:300)
          at org.jboss.ejb.Application.start(Application.java:201)
          at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
          at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
          at java.lang.reflect.Method.invoke(Native Method)
          .
          .

          I would greatly appreciate any assistance!

          • 2. Re: ejbCreate<Method> reportin error
            cepage

            OK, it appears that this is a known bug with JBoss:

            http://sourceforge.net/tracker/index.php?func=detail&aid=493188&group_id=22866&atid=376685

            Seems like a pretty major bug to me, since it restricts the number of ways that you can instantiate a bean. Hope it gets addressed soon.

            Corby