jInterop - 访问被拒绝[0x00000005]

时间:2017-08-10 06:05:54

标签: java access com-interop denied

我们有一个带有java组件和com组件的应用程序,通过j-Interop促进它们之间的通信。

我们已经使用了近3年而没有出现重大问题,但直到最近我们才发现我们的java组件在尝试与com对象进行通信时出现错误 - 访问被拒绝[0x00000005]。

com对象正在运行我们已经进行了相同的测试,并且在此异常之后已经多次验证了DCOM配置。

DCOM设置已根据以下链接进行验证 - http://www.softwaretoolbox.com/dcom/html/configuring__local_security_settings1.html

我们使用的版本是j-interop-3.0。

我们也在微软的支持下采取了这一措施,并且根据联合调试推断出调用没有到达ole层,因此我们需要调查j-Interop抛出的错误。

我们面临此问题的服务器环境是Windows Server R2 2008标准和Windows Server 2016 Standard。

为了解决这个问题,有什么可以做的不同吗?

下面是我们得到的错误的完整堆栈跟踪:

Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JIComOxidRuntime$ClientPingTimerT
ask run
INFO: Running ClientPingTimerTask !
Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JIComOxidRuntime$ServerPingTimerT
ask run
INFO: Running ServerPingTimerTask !
Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JISession createSession
INFO: Created Session: 1042741037
Aug 09, 2017 4:30:16 PM org.jinterop.dcom.common.JISystem internal_dumpMap
INFO: mapOfHostnamesVsIPs: {}
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending BIND
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processIncoming
INFO:
Recieved BIND_ACK
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending AUTH3
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending REQUEST
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processIncoming
INFO:
Recieved FAULT
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 s
uch exceptions. [0x00000005]
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:661)
at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:496)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:460)
at TestConnectivity.initialize(TestConnectivity.java:128)
at TestConnectivity.HDAconnect(TestConnectivity.java:165)
at TestConnectivity.main(TestConnectivity.java:82)
Caused by: rpc.FaultException: Received fault. (unknown)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:1
41)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:626)
... 5 more
Exited
Aug 09, 2017 4:30:16 PM org.jinterop.dcom.core.JISession postDestroy
INFO: About to destroy links for Session: 1042741037 , size of which is 0

任何帮助将不胜感激。

谢谢。

1 个答案:

答案 0 :(得分:1)

希望以下解决方案适合您。它对我有用。

将以下补丁应用于注册表:

HKEY_LOCAL_MACHINE \ SOFTWARE \微软\的Windows \ CurrentVersion \政策\系统 创建或修改32位DWORD:LocalAccountTokenFilterPolicy 将值设置为:1

您可以参考https://answers.microsoft.com/en-us/windows/forum/windows_7-security/getting-access-is-denied-when-accessing-windows-7/23369f35-bc45-4147-9c3e-74a47d530757

- SK