2 Replies Latest reply on Jul 5, 2003 12:12 PM by gatep5

    Session Bean abstract methods???

    gatep5

      I have a stateless session bean in which I have defined two methods: addBlog and getBlog. The methods are void and BlogLocal respectively. When I try to deploy the bean, a Deployment exception says that I should have the same methods declared in the bean class as I do in the remote interface. Below is how I have decalred the methods first in the bean class and then in the remote interface:

      Bean Class Declaration:
      public void addBlog(Integer id, String body, String date, String quote) {
      ......
      }

      public BlogLocal getBlog(Integer id) { ...... }

      Remote Interface Declaration:

      public void addBlog(Integer id, String body, String date, String quote) throws RemoteException;

      public BlogLocal getBlog(Integer id) throws RemoteException;

      Here are the error messages that am receiving:

      14:59:29,332 WARN [verifier] EJB spec violation:
      Bean : BlogAdderEJB
      Method : public abstract void addBlog(Integer, String, String, String) throws RemoteException
      Section: 7.10.5
      Warning: The methods defined in the remote interface must have a matching method in the bean's class with the same name and same number and types of arguments.

      14:59:29,334 WARN [verifier] EJB spec violation:
      Bean : BlogAdderEJB
      Method : public abstract BlogLocal getBlog(Integer) throws RemoteException
      Section: 7.10.5
      Warning: The methods defined in the remote interface must have a matching method in the bean's class with the same name and same number and types of arguments.

      Why would it think that the two methods in the RemoteInterface are "abstract"? Your help is very much appreciated!

      Keith

        • 1. Re: Session Bean abstract methods???
          haraldgliebe

          Hi Keith,

          methods declared in an interface are always public and abstract by the language spec.
          The code you've posted looks correct to me, could you also post the deployment descriptor of the bean?

          Regards,
          Harald

          • 2. Re: Session Bean abstract methods???
            gatep5

            Thanks for the reply! I did finally figure out that I had not specified any information in my jboss.xml file for one of my beans and that was causing the problem. What threw me is that the error messages were occuring for the EJB that already had information in the jboss.xml file. Anyway, thanks again!

            Keith