java 连接PLC 问题总结 Windows machine for DCOM access, so as to avoid such exceptions.  [0x00000005]

具体操作连接详见:https://blog.csdn.net/qq_36079837/article/details/115722521

如果是本机测试不需要配置DCOM

12:32:08.177 [main] INFO org.openscada.opc.lib.da.Server - Failed to connect to server

org.jinterop.dcom.common.JIException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions.  [0x00000005]

       at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:542)

       at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:458)

       at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)

       at org.openscada.opc.lib.da.Server.connect(Server.java:108)

       at tcb.UtgardTutorial1.main(UtgardTutorial1.java:40)

Caused by: rpc.FaultException: Received fault. (unknown)

       at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:142)

       at rpc.Stub.call(Stub.java:112)

       at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:538)

       ... 4 common frames omitted

12:32:08.177 [main] INFO org.openscada.opc.lib.da.Server - Destroying DCOM session...

12:32:08.177 [main] INFO org.openscada.opc.lib.da.Server - Destroying DCOM session... forked

00000005: Unknown error (00000005)

12:32:08.177 [OPCSessionDestructor] DEBUG org.openscada.opc.lib.da.Server - Starting destruction of DCOM session

4月 20, 2021 12:32:08 下午 org.jinterop.dcom.core.JISession postDestroy

信息: About to destroy links for Session: -1432603250 , size of which is 0

4月 20, 2021 12:32:08 下午 org.jinterop.dcom.core.JISession postDestroy

信息: About to destroy links for Session: -1432603250 , size of which is 0

12:32:08.177 [OPCSessionDestructor] INFO org.openscada.opc.lib.da.Server - Destructed DCOM session

12:32:08.177 [OPCSessionDestructor] INFO org.openscada.opc.lib.da.Server - Session destruction took 0 ms

错误原因:

用户名密码不匹配

解决方案:

1.首先检查当前登录用户名密码是否正确。如果正确然后检查当前用户是否有管理员权限,如果没有请开启管理员用户。

2.如果当前登录用户名密码没有问题,那就可能是当前用户不具有管理员权限,需要使用管理员账户登录。

       右键“此电脑”-->“管理”

点击管理打开如图所示:

选中Administrator右键,设置密码,

 

设置完成后右键选择属性,把账户已禁用取消勾选,启用账户。

至此,再次运行程序查看。

如果报错The RPC server is unavailable

请检查下图两项是否正常启动以及防火墙是否关闭

如果出现Message not found for errorCode: 0x80010111 这个错误
出现这个问题是windows问题windows10版本 2004之后的协议都是5.7utgard的协议是5.6的,把win10降到1607就不会报这个错了

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值