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

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

    yashi Newbie

      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?