I have develop java (jdk5) corba client to receive NotificationIRP proactive events from server. My below code is working fine with single network card. if client system have multiple network interfaces, call back always selecting wrong network card and failed to connect to client. I have tried by specifying -ORBEndpoint argument in orb. But still no success.
String[] args = new String[2];
args[0]="-ORBEndpoint";
args[1]="iiop://10.106.90.50:9090"; // client eth0
ORB orb = ORB.init(args, null);
First of all you should not specify any port number (e.g. in case that port is already bound by another process), but only the IP address. The port number should be chosen randomly by the ORB, from available ports.
Then you can configure this Java property:
-Dcom.sun.CORBA.ORBServerHost=<IP address>
or if you really want to hardcode it:
Properties p = new Properties();
p.put("com.sun.CORBA.ORBServerHost", "10.106.90.50");
ORB orb = ORB.init(args, p);
ORBEndpoint is a configuration for omniORB, not for the Sun/Oracle Java ORB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With