After executing idltojava and having activated in each
command below in 2 DOS windows prompt
tnameserv -ORBInitialPort 1099
java HelloServer -ORBInitialPort 1099 --ORBInitialHost myMachine
I ran
java HelloClient -ORBInitialPort 1099 --ORBInitialHost myMachine
yielding the errors shown below right after the HelloClient.java line
Hello helloRef = HelloHelper.narrow(ncRef.resolve(path));
Does anyone know which precautions I should have taken
like setting CLASSPATH to c:\jdk1.2.1\lib or something else?
Any help is appreciated. Thanks!
Carlos
The error message:
ERROR do HelloClient : org.omg.CORBA.NO_IMPLEMENT: minor code: 0
completed: No
org.omg.CORBA.NO_IMPLEMENT: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:239)
at
com.sun.CORBA.iiop.ReplyMessage.getSystemException(ReplyMessage.java:75)
at
com.sun.CORBA.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:85)
at com.sun.CORBA.idl.RequestImpl.doInvocation(Compiled Code)
at com.sun.CORBA.idl.RequestImpl.invoke(RequestImpl.java:219)
at HelloApp._HelloStub.sayHello(_HelloStub.java:30)
at HelloClient.main(HelloClient.java:32)
The Client.java code:
import HelloApp.*; // The package containing our stubs.
import org.omg.CosNaming.*; // HelloClient will use the naming service.
import org.omg.CORBA.*; // All CORBA applications need these
classes.
public class HelloClient
{
public static void main(String args[])
{
try{
// Create and initialize the ORB
ORB orb = ORB.init(args, null);
// Get the root naming context
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
// Resolve the object reference in naming
NameComponent nc = new NameComponent("Hello", "");
NameComponent path[] = {nc};
Hello helloRef = HelloHelper.narrow(ncRef.resolve(path));
System.out.println("HelloClient: after narrow"); //
succeded in printing this
// Call the Hello server object and print results
String Hello = helloRef.sayHello();
System.out.println(Hello);
} catch(Exception e) {
System.out.println("ERROR do HelloClient : " + e);
e.printStackTrace(System.out);
}
}
}
It seems to me that you've ran into the same problem with mine. Can you post the IDL and
describe the configuration of your platform (which idl-java compiler, which
version,...)?
In my test, I've succeeded to pass/receive the simple mesages (ie, strings) between
client/servers, but the same exception (getSystemException) was raised when I tried to
pass/receive the object references.
Hope we can coordiante,
Son