java链接opc报异常org.jinterop.dcom.common.JIException: Access is denied解决

记录一下这次从发现问题到解决问题的过程
项目是通过java链接OPC,读取数据,并且发送数据的
程序一直运行正常,最近客户反馈说无法读取数据,通过查看,发现访问异常了。花了2天的时间才解决了这个异常。

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:118)
	at opc.apply.threads.ReadDataThread.getServer(ReadDataThread.java:231)
	at opc.apply.threads.ReadDataThread.run(ReadDataThread.java:57)
	at java.lang.Thread.run(Thread.java:745)
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)
	... 6 more

通过看异常日志,发现是访问被拒绝了,百度查看资料,尝试了以下几种方案:
1、修改注册表https://blog.csdn.net/yigerendengqingtian/article/details/84710809
2、添加一段代码

this.session.useSessionSecurity(true);

https://blog.csdn.net/hzf1993/article/details/81188538
3、配置DCOM
https://www.softwaretoolbox.com/dcom/html/configuring__opcenum1.html
4、查看windows日志,找问题
查看windows安全日志,确认问题
通过查看日志,发现是帐户登录失败,具体分析是密码错误,尝试重新设置密码,解决了(其实密码并没有改变,但是不知道为什么会提示密码错误)

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值