luoyan35714 / OPC_Client

OPC client examples
https://www.hifreud.com/tag/#OPC-ref
Apache License 2.0
210 stars 157 forks source link

使用KingView做opc server,尝试连接会有0x80070005异常 #7

Closed stonedong closed 2 years ago

stonedong commented 3 years ago

错误: Exception in thread "main" org.jinterop.dcom.common.JIException: Access is denied. [0x80070005] at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:664) at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:561) at org.jinterop.dcom.core.JIComServer.(JIComServer.java:524) at org.openscada.opc.lib.da.Server.connect(Server.java:108) at cn.dst.opc.App.main(App.java:41) Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied. [0x80070005] at org.jinterop.dcom.core.JIRemActivation.read(JIRemActivation.java:225) at ndr.NdrObject.decode(NdrObject.java:41) at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:141) at rpc.Stub.call(Stub.java:134) at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:649) ... 4 more

测试代码: ConnectionInformation ci = new ConnectionInformation(); ci.setHost("192.168.254.119"); ci.setDomain(""); // 这里是电脑登录账号密码 ci.setUser("OPCServer"); ci.setPassword("12345678"); ci.setClsid("21C3E5E0-B7E4-11d4-8BE0-0050BACFBB99");

    Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor());
    server.connect();

请问一下,原因是啥?

luoyan35714 commented 2 years ago

你的错误信息里写的是,Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied. [0x80070005] 我已经好久没有继续做OPC了,所以提供不了太多有意义的帮助,抱歉