3 Replies Latest reply on Nov 9, 2001 6:45 AM by Ben Turner

    Return values for User Interfaces ?

    Ben Turner Newbie

      I am trying to deploy a "User" ejb on JBoss 2.2.2 server.

      The problem I am having is a "Verifier" error wehn I deploy the User Entity Bean. The error reads :

      "Warning: the method return values in the home interface must be of valid types for RMI/IIOP"

      However, my Remote interface code is as follows :

      public interface User extends javax.ejb.EJBObject {
      public UserPK getKey() throws java.rmi.RemoteException;

      and my home interface is as follows :

      import javax.ejb.CreateException;
      import java.rmi.RemoteException;
      import javax.ejb.FinderException;

      public interface UserHome extends javax.ejb.EJBHome {
      public User create(UserPK pk, String password) throws CreateException, RemoteException;
      public User findByPrimaryKey(UserPK pk) throws FinderException, RemoteException;

      So my questions appear to be these :

      * Do I need to extend java.io.Serializable in my Remote interface ? I have not seen this done in any other EJB examples (including the Interest example in the JBoss online manual).

      * Have I not followed some convention in my EJB where it "ignores" the RMI/IIOP constraint for "fixed" methods such as create() and findByXXX() ?

      * Can anyone see or guess at why I am getting these errors ?

      Thanks, all help appretiated (sp?) !


        • 1. Re: Return values for User Interfaces ?
          Dan Christopherson Newbie

          It's more likely to be your UserPK than your remote. The error message is very misleading.

          • 2. Re: Return values for User Interfaces ?
            Ben Turner Newbie

            Unforntunaley, my UserPK does extend java.io.Serializable (as do all my model / value objects) and I am still seeing the error.

            Is there something more I need to include (other than Serializable ?) Or prehaps something that needs to be in the deployment descriptor ? Just incase, I enclose my deployment descriptor below :

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">



            • 3. Re: Return values for User Interfaces ?
              Ben Turner Newbie

              Bad form - but I'm replying to my own result.

              Through painful commenting and uncommenting of code, I found that my Remote Interface was infact trying to throw an EJBException as well as the RemoteException from the getKey() method.

              Not sure how I missed this - I feel a bit of a fool ! - but thought I should post this reply incase anyone has a similar problem. So in colclusion :

              Because a method in my REMOTE interface was throwing an invalid RMI/IIOP exception (EJBException in this case), it was reported in the verifier as an error in the home interface return values.

              Hope this is of use to anyone else who gets in this situation, very frustrating !