JAVA ,Utgard 获取opcServerList 报错 Class not registered 5C

获取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个回答

 在注册表里

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID
   {这里是你的com组件的guid}
      DllSurrogate = 设置为你的com组件的路径和文件名
weixin_42151835
weixin_42151835 有解决了的吗?麻烦回复一下谢谢
4 个月之前 回复
weixin_41155628
weixin_41155628 怎么设置?
6 个月之前 回复
weixin_41155628
weixin_41155628 怎么设置
6 个月之前 回复
weixin_41155628
weixin_41155628 这个问题是怎么解决的呢
6 个月之前 回复
bobo438074203
bobo438074203 回复她℃: 你解决了吗?
一年多之前 回复
weixin_44399114
她℃ com组件的路径是物理路径吗?从哪里获取?
一年多之前 回复
weixin_44399114
她℃ 回复oliver223: 请问问题解决了没有?
一年多之前 回复
oliver223
oliver223 感谢啊
2 年多之前 回复
oliver223
oliver223 回复caozhy: 可否远程协助一下
2 年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复oliver223: 就是你的opc组件
2 年多之前 回复
oliver223
oliver223 我也不知道我com组件在哪里啊, guid 也不知道
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐