I'm stuck on an RMI problem where I've sort of figured out why it's failing, but I don't have a clue on what the fix needs to be. The problem is essentially occurring on a method call where an RMI object is getting passed to the server as an argument. This is resulting in an exception when Stub.connect() is called because the object delegate is null:

|org.omg.CORBA.BAD_OPERATION:  vmcid: 0x0 minor code: 0x0  completed: No|
|    at org.omg.CORBA.portable.ObjectImpl._get_delegate(ObjectImpl.java:24)|
|    at org.apache.yoko.rmi.impl.RMIStub._get_delegate(RMIStub.java:76)|
|    at org.apache.yoko.rmi.impl.StubImpl.connect(StubImpl.java:46)|
|    at javax.rmi.CORBA.Stub.connect(Stub.java:49)

The object's delegate is set to null during processing of a call to PortableRemoteObject.narrow() resulting from a call to RMIPersistentStub.readResolve(). The value used on the set call is null.


|
|at org.apache.yoko.rmi.impl.RMIStub._set_delegate(RMIStub.java:83)|
|    at 
org.apache.yoko.rmi.impl.PortableRemoteObjectImpl.narrow(PortableRemoteObjectImpl.java:204)|
|    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:56)|
|    at 
org.apache.yoko.rmi.impl.RMIPersistentStub.readResolve(RMIPersistentStub.java:48)|
|    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|
|    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)|
|    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)|
|    at java.lang.reflect.Method.invoke(Method.java:324)|
|    at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:925)|
|    at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655)|
|    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)|
|    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)


This is occurring because this code in PortableRemoteObjectImpl.narrow() is getting the BAD_OPERATION exception because the object in question has not had a delegate set.
           org.omg.CORBA.portable.Delegate delegate;
           try {
               // let the stub adopt narrowFrom's identity
               delegate = object._get_delegate();

           } catch (org.omg.CORBA.BAD_OPERATION ex) {
               // ignore
               delegate = null;
           }


It appears that the reason this has not had a delegate set is because the RMIPersistentStub instance was instantiated during the deserialization process using the default constructor, which does not set a delegate. So, what should be happening here? This test case is unfortunately part of the tck, so I can't really give a lot of details out except to people who have signed the tck NDA.
Rick


|



Reply via email to