2 Replies Latest reply on Mar 23, 2003 10:58 PM by Collin

    Alternate create method not working (ejbVersion)

    Collin Novice

      Hi,

      My normal ejbCreate and ejbPostCreate methods work just fine. However, I wanted to create a versioning create method that will automate the creation of a new entity based on the old entity's data.

      /**
      * @ejb:create-method
      */
      public String ejbVersion(com.hannonhill.object.interfaces.VersionedEntity entity) throws CreateException {
      super.ejbCreate(entity.getName());
      setVersion(entity.getVersion() + 1);
      setIsCurrentVersion(false);
      return null;
      }

      public void ejbPostVersion(com.hannonhill.object.interfaces.VersionedEntity entity) throws CreateException {
      // for now, do nothing.
      }


      Those are my method definitions. Everything compiles just fine, but when JBoss deploys, I get this error message:

      10:09:15,977 INFO [EJBDeployer]
      Bean : MetadataAwareEntity
      Method : public abstract MetadataAwareEntity version(MetadataAwareEntity) throws CreateException
      Section: 12.2.11
      Warning: Each local home method must match a method defined in the entity bean class.

      In my generated (xdoclet) CMP class, there's no ejbVersion, as that is contained within the superclass, just like ejbCreate. So there IS a matching method as far as I can see.

      I'm sure I'm missing something fairly obvious... any help on this would be great!

      thanks-
      Collin