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
nobody miss the question? who can help me.