3 Replies Latest reply on Feb 12, 2002 8:21 AM by Albena

    ejbHome method not recognized

    Albena Newbie

      I have implemented an ejbHomeTotalAmountOfWords
      method in my WoordBean class, that performs operation
      related to the EJB component but that is not specific to a WoordBean instance. This methods calculates all the
      word records in the underlying database.

      public int ejbHomeTotalAmountOfWords() throws WoordException {
      PreparedStatement pstat = null;
      Connection conn = null;

      I have also declared a matching method
      public int totalAmountOfWords() throws RemoteException, WoordException;
      in the home interface of my bean WoordHome.

      When I try to deploy the bean, I get this verifier

      [10:03:05,906,ContainerFactory] Verifying
      3.0.0alpha/deploy/Default/woordenboek.jar/ejb1007.jar [10:03:06,281,Default] New woord bean

      [10:03:06,406,ContainerFactory] Bean :
      Method : public abstract int totalAmountOfWords() throws RemoteException, WoordException Section: 9.2.8
      Warning: Each method defined in the entity bean's home interface must be either create or finder method.

      Does someone sees where do I go wrong? Thanx - The Fairy

        • 1. Re: ejbHome method not recognized
          Armin Newbie

          Sounds like the container is not recognizing that you are deploying a 2.0 entity. This can happen if the ejb-jar.xml doctype is not correct. If you are not already, try using:

          <!DOCTYPE ejb-jar PUBLIC
          "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"

          Hope this helps

          • 2. Re: ejbHome method not recognized
            Julien Dubois Newbie


            I've got exactly the same problem.
            I'm trying to run the code from "Mastering EJB II, 2nd edition" (see theserverside.com). This concerns the "account" exemple, on the BMP Entity Beans.
            Anyway :
            - I've got the same kind of code (an ejbHome*() method).
            - I've got the same error message (it says we can only have finder and create methods)
            - I've tried to change the XML header, following armint's advice, with no success.

            I'm using JBoss 2.4.

            Anybody to help?

            Julien Dubois.

            • 3. Re: ejbHome method not recognized
              Albena Newbie

              Thanx Armin for the tip. I thought it must be something
              with the new EJB specification, where thr ejbHome methods
              were introduced.

              I have changed the ejb-jar.xml doctype according to your
              instruction and it works perfectely now.

              Julien, as I used the same example as you (Account), the
              only difference I can see is the jboss version. I am
              using jboss-3.0.0alpha

              Success! The Fairy