如何在Java中使用特定的IP和端口生成IOR

如何在Java中使用特定的IP和端口生成IOR,java,corba,openorb,Java,Corba,Openorb,我正在调试Corba代码的服务器部分,我解码了生成的IOR,但是当我在orb_init()中更改时,ip没有被更改。 下面是我的一段代码: String[] args = new String[4]; args[0] = "-ORBInitialPort"; args[1] = "69455"; args[2] = "-ORBInitialHost"; args[3] = "127.0.0.1";

我正在调试Corba代码的服务器部分,我解码了生成的IOR,但是当我在orb_init()中更改时,ip没有被更改。 下面是我的一段代码:

String[] args = new String[4];
            args[0] = "-ORBInitialPort";
            args[1] = "69455";
            args[2] = "-ORBInitialHost";
            args[3] = "127.0.0.1"; 
orb = org.omg.CORBA.ORB.init(args,null);
org.omg.CORBA.Object objPoa = orb.resolve_initial_references("RootPOA");
rootPOA = org.omg.PortableServer.POAHelper.narrow(objPoa);
org.omg.CORBA.Object obj = ((org.omg.PortableServer.Servant)this)._this_object(orb);
String1  = orb.object_to_string(obj);
java.io.FileOutputStream File = new java.io.FileOutputStream(IORFile);
java.io.PrintStream pfile=new java.io.PrintStream(File);
pfile.println(String1);
每次我在中更改IP时:

args[2] = "-ORBInitialHost";
args[3] = "127.0.0.1";
其打印相同的ip和端口(3.222.123.22),下面是解码的ior内容:

_IIOP_ParseCDR:  byte order BigEndian, repository id <IDL:CfiSii:1.0>, 1 profile
_IIOP_ParseCDR:  profile 1 is 96 bytes, tag 0 (INTERNET), BigEndian byte order
(iiop.c:parse_IIOP_Profile):  bo=BigEndian, version=1.2, hostname=3.222.123.22, port=49630, object_key=<.OO.qU..W...POA.9...>
(iiop.c:parse_IIOP_Profile):  encoded object key is <%00OO%01qU%83%1CW%01%00%00POA%FE9%A4%AF%98>
(iiop.c:parse_IIOP_Profile):  non-native cinfo is <iiop_1_2_1_%2500OO%2501qU%2583%251CW%2501%2500%2500POA%25FE9%25A4%25AF%2598@tcp_3.222.123.22_49630>
object key is <#00OO#01qU#83#1CW#01#00#00POA#FE9#A4#AF#98>;
 no trustworthy most-specific-type info; unrecognized ORB type;
 reachable with IIOP 1.2 at host "3.222.123.22", port 49630
\u IIOP\u ParseCDR:byte order BigEndian,存储库id,1个配置文件
_IIOP_ParseCDR:profile 1是96字节,标记0(互联网),双字节顺序
(iiop.c:parse_iiop_Profile):bo=BigEndian,版本=1.2,主机名=3.222.123.22,端口=49630,对象密钥=
(iiop.c:parse_iiop_Profile):编码的对象键为
(iiop.c:parse_iiop_Profile):非本地cinfo是
对象键为;
没有值得信赖的最具体的类型信息;无法识别的ORB类型;
可通过主机“3.222.123.22”端口49630处的IIOP 1.2访问
请有人帮助我,我缺少什么,或者我需要做什么,以便将更新的IP合并到IOR中


谢谢。

尝试java
ORBServerHost
as属性,如中所示