-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 07/24/2001
NamingContext rebind operation throws unexpected NotFound exception
in jdk build 1.4.0-beta_refresh-b69,
if it's called after bind_new_context().
All works correctly in b65.
See example
------------- Test.java ---------------------
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
public class Test {
static ORB orb = null;
public static void main(String argv[]) {
try {
orb = ORB.init(argv, null);
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("Test", "");
NameComponent path[] = {nc};
ncRef.bind_new_context(path);
ncRef.rebind(path, objRef);
} catch(UserException e) {
System.out.println("ERROR : " + e);
e.printStackTrace(System.out);
} finally {
orb.shutdown(true);
orb.destroy();
}
}
}
------------------- start --------------------
#> tnameserv -ORBInitialPort 9876 &
#>javac -classpath . -d . Test.java
#>java -classpath . Test -ORBInitialPort 9876
----------------- 1.4.0-beta_refresh-b69 output -----------------
ERROR : org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
at org.omg.CosNaming._NamingContextExtStub.rebind(_NamingContextExtStub.java:313)
at Test.main(Test.java:18)
======================================================================