-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 07/11/2001
CORBA method invocations work unstable.
See an example.
It creates corba object and calls its method 100 times.
Sometimes org.omg.CORBA.OBJECT_NOT_EXIST exception is thrown by the method.
--------------- Test.idl -------------------
module TestApp {
interface Test {
string changeString();
};
};
------------- ORBTest.java ---------------------
import TestApp.*;
import org.omg.CORBA.*;
public class ORBTest {
public static void main(String argv[]) {
ORB orb = null;
for (int i=0;i<100;i++) {
try {
orb = ORB.init(argv, null);
TestServant test = new TestServant(i);
orb.connect(test);
runClient(argv, orb.object_to_string(test));
} catch(Exception e) {
System.out.println("ERROR : " + e);
e.printStackTrace(System.out);
} finally {
orb.shutdown(true);
orb.destroy();
}
}
}
public static void runClient(String argv[], String ref) {
ORB orb = null;
try {
orb = ORB.init(argv, null);
Test testRef = TestHelper.narrow(orb.string_to_object(ref));
System.out.println(testRef.changeString());
} catch(Exception e) {
System.out.println("ERROR : " + e);
e.printStackTrace(System.out);
} finally {
orb.shutdown(true);
orb.destroy();
}
}
}
class TestServant extends _TestImplBase {
int i = 0;
public TestServant (int i) {
this.i = i;
}
synchronized public String changeString(){
return "" + i;
}
}
------------------- start --------------------
#> idlj -oldImplBase -fall Test.idl
#>javac -classpath . -d . ORBTest.java TestApp/*.java
#>java -classpath . ORBTest
----------------- a part of output -----------------
22
23
24
25
ERROR : org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: SUN minor code: 204 completed: No
org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: SUN minor code: 204 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:33)
at sun.reflect.InflatableConstructorAccessorImpl.newInstance(InflatableConstructorAccessorImpl.java:38)
at java.lang.reflect.Constructor.newInstance(Constructor.java:273)
at java.lang.Class.newInstance0(Class.java:290)
at java.lang.Class.newInstance(Class.java:249)
at com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:85)
at com.sun.corba.se.internal.iiop.LocalClientResponseImpl.getSystemException(LocalClientResponseImpl.java:104)
at com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:266)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:460)
at TestApp._TestStub.changeString(_TestStub.java:19)
at ORBTest.runClient(ORBTest.java:39)
at ORBTest.main(ORBTest.java:17)
27
28
29
30
31
======================================================================