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 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题