1 2 Previous Next 17 Replies Latest reply on Jun 23, 2003 2:04 PM by sugramoin

    "method return values in the home interface must be valid ty

    shayman

      Hi All,

      I'm keep on getting these messages about return values that are not valid for RMI/IIOP. The classes my factory returns are implementing javax.ejb.SessionBean (which implements Enterprise bean which is serializable), and EJBObject which extend java.rmi.Remote.

      I have few Session beans like that, all of the implement the same things, and their deployment descriptor is the same. Still I keep on getting this warning only for those 2.

      Any suggestions how to solve it? The relevant part of the log/console is attached below.

      Shay.


      Log:

      ....
      [Auto deploy] Starting
      [Auto deploy] Watching D:\Java\products\jboss-2.2\deploy
      [Auto deploy] Auto deploy of file:/D:/Java/products/jboss-2.2/deploy/tmc-generic-server.jar
      [J2EE Deployer Default] Deploy J2EE application: file:/D:/Java/products/jboss-2.2/deploy/tmc-generic-server.jar
      [J2EE Deployer Default] Create application tmc-generic-server.jar
      [J2EE Deployer Default] install module tmc-generic-server.jar
      [Container factory] Deploying:file:/D:/Java/products/jboss-2.2/tmp/deploy/Default/tmc-generic-server.jar
      [Verifier] Verifying file:/D:/Java/products/jboss-2.2/tmp/deploy/Default/tmc-generic-server.jar/ejb1001.jar
      [Verifier]
      Bean : com.mycompany.tmc.bizprocess.Server
      Method : public abstract ServerRemote create() throws CreateException, RemoteException
      Section: 6.10.6
      Warning: The method return values in the home interface must be of valid types for RMI/IIOP.

      [Verifier]
      Bean : com.mycompany.tmc.bizprocess.License
      Method : public abstract LicenseRemote create() throws CreateException, RemoteException
      Section: 6.10.6
      Warning: The method return values in the home interface must be of valid types for RMI/IIOP.

      [Container factory] Deploying com.mycompany.tmc.bizprocess.AIMs

      ....

        • 1. Re:
          hstech

          Hi Shay,

          I'm assuming that "Server" is your session bean, and "ServerRemote" is the remote interface to that bean.

          Can you confirm:

          (1) Your home interface is something like

          public interface ServerHome extends EJBHome {
          
           public ServerRemote create()
           throws CreateException, RemoteException;
          
           ...then any finder declarations...
          
          }
          


          (2) Your remote interface contains:

          public interface ServerRemote extends EJBObject {
          
           ...your method declarations...
          
          }
          


          (3) Your session bean contains:

          public class Server implements SessionBean {
          
           public void ejbCreate()
           throws CreateException {
          
           ...your implementation...
          
           }
          
           ...all of your other method implementations...
          
          }
          


          Aaron.

          • 2. I also have this problem...
            richbolen

            If anyone has found a solution, please post.

            Thanks,
            Rich

            • 3. Re: Re: "method return values ... must be valid for RMI/IIOP
              shayman

              Aaron,

              You understood right about the server and server remote classes.
              My code is almost exactly as you showed.

              The only differences are:
              A. My Home is declared as:
              public interface ServerHome extends TopazBizProcessHome
              where TopazBizProcessHome is an empty interface that extends EJBHome
              B. My Bean implementation is declared as:
              public class ServerBean extends ServerImpl implements SessionBean
              where ServerImpl is my implementation class. The ServerBean has the ejbCreate method like you showed here.

              These are all the difference. The weird thing is this is not the only bean I have, and all look the same, but only this one is genereating this warning message.

              Thanks for the help
              Shay.

              • 4. invalid types for RMI/IIOP
                adrian

                I have the same problem. The verifier complains about invalid types for RMI/IIOP. Is this a known JBoss problem?

                thanks,
                Adrian


                // JBoss Log
                26 Sep 2001 10:13:29 [INFO ] Verifier - Verifying file:/D:/Jboss/jboss/tmp/deploy/Default/uos.ear/ejb1002.jar
                26 Sep 2001 10:13:29 [INFO ] Verifier -
                Bean : UOS
                Method : public abstract Uos create() throws RemoteException, CreateException
                Section: 6.10.6
                Warning: The method return values in the home interface must be of valid types for RMI/IIOP.




                // Home Interface
                public interface UosHome extends EJBHome {
                public Uos create() throws RemoteException, CreateException;
                }

                // Remote Interface
                public interface Uos extends EJBObject {
                ...
                }

                // Bean implementation
                public class UosBean implements SessionBean {

                public void ejbCreate() throws javax.ejb.CreateException {
                ...
                }
                }

                • 5. Re: invalid types for RMI/IIOP

                  > 26 Sep 2001 10:13:29 [INFO ] Verifier -
                  > Bean : UOS
                  > Method : public abstract Uos create() throws
                  > RemoteException, CreateException
                  > Section: 6.10.6
                  > Warning: The method return values in the home
                  > interface must be of valid types for RMI/IIOP.

                  ...

                  > // Remote Interface
                  > public interface Uos extends EJBObject {
                  > ...
                  > }


                  The warning is generated here, ie. in the return type of the create() method, your Remote interface declaration.

                  Most common cause is declaring a runtime exception to be thrown from the remote method.

                  -- Juha

                  • 6. Re: invalid types for RMI/IIOP
                    shayman

                    Hi Juha,

                    I can't say I understood your answer. Does the create method throws a runtime exception, or does a method of the remote interface? I can't see in the examples any of them declaring to throw such an exception, and I know my code doesn't throw one, as it is deployed silently on Oracle OC4J.

                    Can you please clarify your answer?

                    TIA.
                    Shay.

                    • 7. Re: invalid types for RMI/IIOP
                      adrian

                      Thanks juha, that was the cause of the problem. One of the business methods on the remote interface erroneously declared a runtime exception (EJBException) in the throws clause. E.g.

                      public ServiceProductBundle getProductCodes() throws RemoteException, EJBException;

                      thanks,
                      Adrian

                      • 8. Re: invalid types for RMI/IIOP
                        shayman

                        ok, I understand the answer now, and removed all runtime exceptions from the remote interface. Still, I keep on getting the same warning.
                        I tried to look at the verifier's code, but didn't find a clue.
                        The return types, arguments and exceptions of my remote and bean are all serializable and no runtime exceptions are thrown. Where else should I look?

                        Shay.

                        • 9. Re: invalid types for RMI/IIOP
                          hstech

                          Hi Shay,

                          Just a thought, but why don't you try taking out the intermediate interface (the Topaz... interface) and extend directly from the standard J2EE interface to see if that changes anything.

                          Cheers,
                          Aaron.

                          • 10. Re:
                            bedal.

                            This message may have two reasons:
                            1.
                            you did not point 'throws RemoteException' in getters/setters of remote interface
                            2.
                            you did point 'throws EJBException' in methods of bean class.

                            • 11. Re: Re:
                              hraun

                              Hi,
                              I'd been getting this message for ages, but I've just fixed it.
                              My problem was that I was using one of my own exceptions (UnavailableTeacherException). I was declaring this exception in quite a few of the business methods in my Remote Interface. The problem seemed to be that my Exception extended EJBException instead of java.lang.Exception. Since changing the extends clause of my UnavailableTeacherException class, I no longer get this error when deploying my session bean.
                              Wahey.
                              So try looking at your exceptions and helper classes too.
                              Peet

                              • 12. Re: method return values ... must be valid type for RMI/IIOP
                                shayman

                                Hi All,
                                Thanks for all of you for the kind help. At last I managed to solve the problem. I had no problem with exceptions, but I had one member variable declared in my remote class. This was a constant which was an Integer, and this caused the problem. I've changed this to a primitive int, and now all is well.
                                Once again, thanks to all of you for your help.

                                Shay.

                                • 13. Re: "method return values in the home interface must be vali

                                  my problem was that I had public static final
                                  constants in the remote interface, of type
                                  String (was was no problem), and of type String[],
                                  which caused the message discussed in this thread...

                                  Switching back to a comma-separated String ;-)
                                  solved the problem.

                                  • 14. Re: "method return values in the home interface must be vali
                                    icanoop

                                    I am having this problem also, except none of the situations described above seem to apply to me.

                                    Here is my remote

                                    public interface Requirement extends EJBObject {
                                    // The rule for this requirement.
                                    String getRule();
                                    void setRule(String rule);

                                    // The human readable description of this
                                    // This is an optional.
                                    String getDescription();
                                    void setDescription(String desc);
                                    }

                                    and here is my home

                                    public interface RequirementHome extends EJBHome {

                                    Requirement create(String rule) throws CreateException, RemoteException;

                                    Collection findAll() throws FinderException,
                                    RemoteException;

                                    Requirement findByPrimaryKey(String pk) throws FinderException,
                                    RemoteException;
                                    }


                                    I don't have any members in the interfaces, I don't throw any Exceptions in the Bean.

                                    Any ideas?

                                    1 2 Previous Next