[omniORB] Using omniNames with Java Client (sun's IDL)

Herve Lehoux hlehoux@ADWAYS.com
Fri, 7 May 1999 16:24:02 +0100


> I evoke my Java client in standard way:
> 
> > Java BugClient -ORBInitialHost devin -ORBInitialPort 6239
> 
> and I get this error:
> 
> ERROR : org.omg.CosNaming.NamingContextPackage.NotFound
> org.omg.CosNaming.NamingContextPackage.NotFound
> 

the following code works for me :
public class main {

    public static void main(String[] args) {

		org.omg.CORBA.ORB orb =
org.omg.CORBA.ORB.init(args,null);

		String[] s = orb.list_initial_services();
	}
}

started with java main -ORBInitialHost <ip-address> -ORBInitialPort
<port-number>

note : i use jdk1.2.1 on NT.

anyway, can anyone explain me how to do it with an applet ?

i try :

	public void init() {
		Properties p = new Properties();
		p.put("ORBInitialHost", "194.250.173.94");
		p.put("ORBInitialPort", "14000");

		org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this,p);
		try {
		    String[] s = orb.list_initial_services();
		}
		catch (org.omg.CORBA.COMM_FAILURE e) {
		    System.err.println(e.toString());
		}

and always get a COM_FAILURE exception with minor code 1 indicating bad
host/port

Rgds, Herve.