10 Replies Latest reply on Aug 18, 2003 2:41 AM by jckuri

    EJBObject sub-class is not valid RMI-IIOP type!

      I am deploying a stateless session bean in JBoss 3.2.1 and I get the following message when the EJB is being deployed by JBoss

      16:03:03,361 WARN [verifier] EJB spec violation:
      Bean : XYZFacadeSession
      Method : public abstract XYZFacadeSessionEJ create() throws CreateException, RemoteException
      Section: 7.10.6
      Warning: The method return values in the home interface must be of valid types for RMI/IIOP.

      XYZFacadeSessionEJ is the remote interface and in my code the create() method is not 'public abstract'

      Has anybody else faced this problem?

        • 1. Re: EJBObject sub-class is not valid RMI-IIOP type!

          Your Remote interface is not an RMI/IIOP type.
          Read the ejb spec, it contains a link with
          for the exact definition.

          Regards,
          Adrian

          • 2. Comments invited from JBoss experts.

            Thanks. I discovered a solution to the problem. It is as follows:

            1. In the Home set the return type of create() to EJBObject rather than the proper remote interface

            2. Deploy the EJB. It will throw a series of errors relating to non-compliance with EJB spec. Probably significant messages here are those relating to the incorrect use of RemoteException i.e. you need to define them for the methods on the remote interface but not for those on the bean. The code that I was testing had lots of such errors. I corrected those and redeployed the bean. The bean deployed without errors.

            3. Restore the correct return value for Home.create(), recompile and deploy. That's it.

            I believe the occurance of those non-compliance errors would have led to the 'invalidation' of the remote interface class which lead JBoss to ultimately conclude that it was not a proper RMI-IIOP type.

            Can anyone help me to understand the issue and comment on my interpretation of this problem?

            Thanks,
            Niranjan

            • 3. Comments invited from JBoss experts.

              Thanks. I discovered a solution to the problem. It is as follows:

              1. In the Home set the return type of create() to EJBObject rather than the proper remote interface

              2. Deploy the EJB. It will throw a series of errors relating to non-compliance with EJB spec. Probably significant messages here are those relating to the incorrect use of RemoteException i.e. you need to define them for the methods on the remote interface but not for those on the bean. The code that I was testing had lots of such errors. I corrected those and redeployed the bean. The bean deployed without errors.

              3. Restore the correct return value for Home.create(), recompile and deploy. That's it.

              I believe the occurance of those non-compliance errors would have led to the 'invalidation' of the remote interface class which lead JBoss to ultimately conclude that it was not a proper RMI-IIOP type.

              Can anyone help me to understand the issue and comment on my interpretation of this problem?

              Thanks,
              Niranjan

              • 4. Re: EJBObject sub-class is not valid RMI-IIOP type!
                andyjeff

                I too have this problem. I have a bean Basket with a Home interface having a declaration

                public interface BasketHome extends EJBHome
                {
                public BasketRemote create()
                throws RemoteException,CreateException;
                }

                and the Remote is declared as

                public interface BasketRemote extends EJBObject
                {
                ....
                }

                so the return type of BasketHome.create() is derived from an EJBObject.

                The error only crops up in 3.2.* of JBoss. I didnt understand your 'solution'. If I change the return type of BasketHome.create() to a EJBObject I would then have to go through my code and cast everything from this method to (BasketRemote) !!!

                Anyone care to explain the problem ?

                • 5. Re: EJBObject sub-class is not valid RMI-IIOP type!
                  andyjeff

                  OK,
                  I'll answer my own question ... it turns out the JBoss message

                  Method : public abstract BasketRemote create() throws RemoteException, CreateException
                  Section: 7.10.6
                  Warning: The method return values in the home interface must be of valid types for RMI/IIOP.

                  is a bit misleading - it does NOT refer to the Home interface!. What it was actually complaining about was that if you have a method in the Remote interface that is not derived from RemoteException then it is incorrect. Would be nice if the JBoss message was corrected to refer to the correct interface.

                  • 6. Re: EJBObject sub-class is not valid RMI-IIOP type!
                    andyjeff

                    and I meant to say

                    ... if you have an Exception thrown by a method in the Remote interface that is not derived from RemoteException ...

                    Hope thats clearer ;-)

                    • 7. Re: EJBObject sub-class is not valid RMI-IIOP type!

                      Post it as a bug report at
                      www.sf.net/projects/jboss

                      An simple example would most likely
                      get this fixed quickly.

                      Regards,
                      Adrian

                      • 8. Re: EJBObject sub-class is not valid RMI-IIOP type!
                        andyjeff

                        OK.

                        Now reported in Sourceforge bug tool as bug 742459.

                        Thx

                        • 9. Re: EJBObject sub-class is not valid RMI-IIOP type!

                          In my case the RMI-IIOP type 'psuedo-error', if I may call it so, was actually preventing the true EJB spc non-compliance errors from being displayed.

                          Changing the Home return type was not a permanent solution. It was just to make the validator go beyond the RMI-IIOP error.

                          The ejb-spec non-compliances that I discovered were also in the remote interface or the bean methods and the Home had nothing wrong in it.

                          The approach that I described helped me as the code that I was testing had a large number of methods and most of them with some form of EJB spec non-compliance. To go through each of them a determine the problem would have been too tedious. I would rather have JBoss report all of them to me in one go.

                          That is what changing the return type of Home.create() to EJBObject helped me to do.

                          Thanks,
                          Niranjan

                          • 10. Re: EJBObject sub-class is not valid RMI-IIOP type!
                            jckuri

                            I had the same problem, and I corrected it by seeing well if the remote interface (the method return value in the home interface) was a valid type for RMI/IIOP.

                            I found that the remote interface had a mistake: one of its methods didn't throw the RemoteException, I corrected it and the warning disappeared when I redeployed my bean.

                            Maybe your classes don't agree with the specifications.

                            I hope it helps you :)