oliver223 2018-05-25 02:10 采纳率: 0%
浏览 3549
已结题

JAVA ,Utgard 获取opcServerList 报错 Class not registered

获取opc Server 列表的时候报错
代码如下

 public static void main(String[] args) throws Exception {
        ServerList serverList = new ServerList("127.0.0.1","Administrator", "fy19941228","127.0.0.1");
           Collection<ClassDetails> classDetails = serverList
                .listServersWithDetails(new Category[] {
                        Categories.OPCDAServer10, Categories.OPCDAServer20,
                        Categories.OPCDAServer30 }, new Category[] {});
        for (ClassDetails cds : classDetails) {
            System.out.println(cds.getProgId() + "=" + cds.getDescription());
        }
}
    报错:

五月 25, 2018 9:46:09 上午 org.jinterop.dcom.core.JIComServer initialise
警告: Got the class not registered exception , will attempt setting entries based on status flags...
Exception in thread "main" org.jinterop.dcom.common.JIException:Class not registered. If you are using a DLL/OCX , please make sure it has "DllSurrogate" flag set. Faq A(6) in readme.html. [0x80040154]
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:550)
at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:458)
at org.jinterop.dcom.core.JIComServer.(JIComServer.java:427)
at org.openscada.opc.lib.list.ServerList.(ServerList.java:60)
at org.openscada.opc.lib.list.ServerList.(ServerList.java:90)
at com.freud.opc.utgard.cases.OPCTest1.main(OPCTest1.java:28)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Class not registered. If you are using a DLL/OCX , please make sure it has "DllSurrogate" flag set. Faq A(6) in readme.html. [0x80040154]
at org.jinterop.dcom.core.JIRemActivation.read(JIRemActivation.java:191)
at ndr.NdrObject.decode(NdrObject.java:19)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:138)
at rpc.Stub.call(Stub.java:112)
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:538)
... 5 more
五月 25, 2018 9:46:09 上午 org.jinterop.dcom.core.JISession postDestroy
信息: About to destroy links for Session: 810216272 , size of which is 0

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-05-25 02:15
    关注
     在注册表里
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID
       {这里是你的com组件的guid}
          DllSurrogate = 设置为你的com组件的路径和文件名
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型