ORbacus java client and C++ server
"Anoop Ahamad" <[email protected]>
| Newsgroups | gmane.comp.corba.orbacus |
|---|---|
| Message-ID | <[email protected]> |
I am using ORBACUS 4.2.x, JDK 1.4.x, ORBACUS for java 4.2.x in Windows 2000 platform.
I have started the namesev and the C++ server also.
When I am trying from a c++ client It is working.
But when I am running the java client it is showing the error listed below
The command I used to run the java program is
java -Xbootclasspath/p:OB.jar JClient -ORBconfig orb.cfg
and
orb.cfg file content is ooc.service.NameService=iioploc://192.168.1.16:8001/NameService
when I am running this it is giving the error:
Exception in thread "main" org.omg.CORBA.INITIALIZE: can't instantiate default O
RB implementation com.ooc.CORBA.ORB vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:308)
at org.omg.CORBA.ORB.init(ORB.java:345)
at JClient.main(JClient.java:17)
I have set the path of OB.jar in classpath variable.
This is my JClient.java file
import java.io.*;
import org.omg.CosNaming.*;
public class JClient {
public static void main(String[] argv) {
java.util.Properties props = System.getProperties();
props.put("org.omg.CORBA.ORBClass", "com.ooc.CORBA.ORB");
props.put("org.omg.CORBA.ORBSingletonClass", "com.ooc.CORBA.ORBSingleton");
System.setProperties(props);
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(argv, props);
// find the naming service
org.omg.CORBA.Object obj = null;
org.omg.CosNaming.NamingContext ctx;
try {
obj = orb.resolve_initial_references("NameService");
} catch(org.omg.CORBA.ORBPackage.InvalidName e) {
e.printStackTrace();
System.exit(1);
}
ctx = org.omg.CosNaming.NamingContextHelper.narrow(obj);
// find the object reference
NameComponent nc = new NameComponent("Hello", "");
NameComponent path[] = {nc};
org.omg.CORBA.Object helloObj = null;
try {
helloObj = ctx.resolve(path);
} catch(Exception e) {
e.printStackTrace();
System.exit(1);
}
//defaultpkg.Hello helloRef = defaultpkg.HelloHelper.narrow(helloObj);
Hello helloRef = HelloHelper.narrow(helloObj);
helloRef.helloWorld();
}
}
Thankas in Advance
Anoop ahamad
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html