1 Reply Latest reply on Feb 16, 2004 7:56 AM by darranl

    java.rmi.Remote class as a return value needs to be Serializ

    yashi

      I have a stateless session bean that defines a business method:

      public MyInterface help() {return new MyImpl();}


      MyInterface is :

      public interface MyInterface implements java.rmi.Remote {

      public void a();

      }


      according to the RMI documentation this interface may be declared as a return parameter of a business EJB method WIHTHOUT explicitly being Serializable (because you pass around an 'interface' proxy not the implementation)



      But, in JBOSS, if the implementation of MyInterface does NOT implement Serializable an exception occurs.



      OK, I 'fixed' it and it is deployed ok. Then I debugged a client application for the bean and it turns out the implementation of the interface in the CLIENT vm is of the implemntation class in the JBOSS vm.


      My question is - why is this so? Why does not JBOSS create its own stub implementations?





        • 1. Re: java.rmi.Remote class as a return value needs to be Seri
          darranl

          Ok I think it is time for you to forget everything you have learnt so far and start again.

          Follow the JBoss getting started guide.

          If you start thinking about RMI you are going in the wrong direction - apart from knowing it is used in the bacground you do not need to know anything about it when using JBoss.