1 Reply Latest reply on Aug 28, 2002 2:50 AM by tp67

    I need you help that how to get Id of ejb object on spec of

    tp67 Newbie

      I get Id of ejb object that it is correct on spec of ejb1.X.that code following:
      public static String getId(EJBObject session) throws Exception {
      try{
      javax.ejb.Handle handle = session.getHandle();
      ByteArrayOutputStream fo = new ByteArrayOutputStream();
      ObjectOutputStream so = new ObjectOutputStream(fo);
      so.writeObject(handle);
      so.flush();
      so.close();
      return new String(fo.toByteArray());
      }
      catch(Exception e){
      xxxxxxxx }
      }

      but.when it be used on ejb2.0 that is not correct.it throws a exception :"java.rmi.MarshalException:Invalid remote object".
      why are it happend,who can tell me.
      BTW: I use jboss-3.0.1RC1_tomcat-4.0.4
      thanks