corba 使用 ior文件 与服务器连接

空清城 发布于 2014/08/22 14:39
阅读 1K+
收藏 0

@齐国隆冬强 你好,想跟你请教个问题:

    //建立连接登录、建立消息通道    
        try {    
            String[] args1 = new String[1];  
            args1[0] = "NameService=IOR:0000021132132...................";        
            orb = org.omg.CORBA.ORB.init(args1, null);    
        } catch (SystemException ex) {     
            System.out.println("初始化ORB对象异常!");    
        }     
 
        org.omg.CORBA.Object objRef = null;   
               NamingContext ncRef=null;
        try {    
            objRef = orb.string_to_object("IOR:000000000000001749444C3A48656C6C6F4....");
            ncRef = NamingContextHelper.narrow(objRef);   
            System.out.println("获取取名字服务成功:"+ncRef);
            
        }catch (org.omg.CORBA.ORBPackage.InvalidName ex) {    
            System.out.println("获取名字服务索引异常!");   
            ex.printStackTrace();   
        } 
---------------------------------------------------------

以上是代码 ..
  在代码中orb  可以得到正确结果 ,,
   但是 调用 orb.string_to_object 获取objRef 的时候 出问题了 ..
   将objRef  传入  ncRef = NamingContextHelper.narrow(objRef);   出错提示

 org.omg.CORBA.BAD_PARAM
  这个可能是什么原因呢???
如果可以的话 ,请你帮我解惑 .


加载中
0
齐国隆冬强
齐国隆冬强
catior IOR:010000002600000049444c3a336770707361352e6f72672f455049525053797374656d2f45504952503a312e30000000010000000000000000010000010102000e00000031302e3230392e3132322e3230007c799f00000014010f004e5550000000890300000001000000526f6f74504f4100694d415053766364504f415f31302e3230392e3132322e32305f6972705f6167656e7400694d415053766364504f415f31302e3230392e3132322e32305f6972705f6167656e745f495250536572766963655f495250536572766963650053657276696365456e76006972705f73657276616e745f706f61000000000001000000313a31000300000000000000080000000107b0aa004f415401000000180000000107b0aa010001000100000001000105090101000000000014000000080000000100a7008600707b 
Type ID: "IDL:3gppsa5.org/EPIRPSystem/EPIRP:1.0"
Profiles:
1. IIOP 1.2 10.209.122.20 31100 "....NUP............RootPOA.iMAPSvcdPOA_10.209.122.20_irp_agent.iMAPSvcdPOA_10.209.122.20_irp_agent_IRPService_IRPService.ServiceEnv.irp_servant_poa.........1:1"
            TAG_ORB_TYPE 0x54414f00
            TAG_CODE_SETS char native code set: ISO-8859-1
                          char conversion code set: UTF-8
                          wchar native code set: UTF-16
                          wchar conversion code set: 
            
            TAG_SSL_SEC_TRANS port = 31600 supports = 167 requires = 134
空清城
空清城
谢谢了
0
齐国隆冬强
齐国隆冬强
[root@web01 log]# catior IOR:010000002300009444c3a466c7578436f6e74726f6c2f466c7578446576696365436f6e663a312e300000010000000000000080000000010102000f0000003136392e3235342e39352e313230000080cd000025000000ff466c75784d616e616765725f506f615f746f6e67687561002d247b5302007dcb000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
Type ID: "IDL:Control/eviceConf:1.0"
Profiles:
1. IIOP 1.2 169.254.95.120 52608 ".Manager_Poa_hua.-${S..}....."
TAG_ORB_TYPE omniORB
TAG_CODE_SETS char native code set: ISO-8859-1
char conversion code set: UTF-8
wchar native code set: UTF-16

wchar conversion code set: UTF-16

用catior看下IOR绑定的对不对

0
空清城
空清城

引用来自“齐国隆冬强”的评论

[root@web01 log]# catior IOR:010000002300009444c3a466c7578436f6e74726f6c2f466c7578446576696365436f6e663a312e300000010000000000000080000000010102000f0000003136392e3235342e39352e313230000080cd000025000000ff466c75784d616e616765725f506f615f746f6e67687561002d247b5302007dcb000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
Type ID: "IDL:Control/eviceConf:1.0"
Profiles:
1. IIOP 1.2 169.254.95.120 52608 ".Manager_Poa_hua.-${S..}....."
TAG_ORB_TYPE omniORB
TAG_CODE_SETS char native code set: ISO-8859-1
char conversion code set: UTF-8
wchar native code set: UTF-16

wchar conversion code set: UTF-16

用catior看下IOR绑定的对不对

catior
这个命令看你是在 Linux下运行的.,
没有装Linux 环境
 我的ior文件你能帮我 执行一下可以吗??
ior文件发布 会照成后面的字符看不到 ..
 如果大哥你有时间的话 请到 我的空间 查看IOR文件 ..
  谢谢你了 ..
 打扰到你,感到十分抱歉 ..

0
齐国隆冬强
齐国隆冬强
查看下OmniName的日志,里面有注册的情况,和自己的比较一下。
空清城
空清城
恩好 的..
返回顶部
顶部