问题描述
我认为我的假冒行为有问题,但我可能会误会.
I am having a problem with I think impersonation, but I could be mistaken.
我有一个IBM XMS使用者,正在使用队列中的数据.工作正常.为了被授予对队列的访问权限,该服务需要以特定用户身份运行,为此,我实现了.Net模拟.在所有系统上,我都能够使队列运行,当需要重新启动时会出现问题.
I have an IBM XMS consumer, consuming data from a queue. Works fine. In order to be granted access to the queue the service needs to be running as specific user, for this I have implemented .Net impersonation. On all systems I am able to get the queue running, the problem occurs when there is a need to restart.
为了测试重新启动,我放置了一个简单的 if(messages == 500)throw ... ,该触发器触发取消,断开连接和重新连接.
To test restart I have placed a simple if(messages == 500) throw... which triggers cancellation, disconnection and reconnection.
我将应用程序作为Windows服务安装到我的本地计算机上,它连接(使用模拟),达到500,抛出,断开连接,重新连接并继续处理消息.但是,当我在服务器上运行相同的代码时,尝试创建队列连接时将失败.这是错误:
I installed the application as a Windows service to my local machine, it connects (using impersonation), reaches 500, throws, disconnects, reconnects and continues to process messages. However when I run the same code on our server it fails while trying to create a queue connection. Here is the error:
链接的异常:System.ComponentModel.Win32Exception(0x80004005): 在拒绝访问 System.Diagnostics.ProcessManager.OpenProcess(Int32 processId,Int32 访问,布尔型throwIfExited)位于 System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, 布尔值firstModuleOnly) System.Diagnostics.ProcessManager.GetModuleInfos(Int32 processId)
在System.Diagnostics.Process.get_Modules()在 IBM.WMQ.CommonServices.TraceEnvironment()在 IBM.WMQ.CommonServices.CreateCommonServices()在 IBM.WMQ.MQBase..ctor()上的IBM.WMQ.CommonServices.TraceEnabled()
在IBM.WMQ.Nmqi.Phconn..ctor(NmqiEnvironment env)处 IBM.WMQ.Nmqi.NmqiEnvironment.NewPhconn()在 IBM.XMS.Client.WMQ.WmqConnection..ctor(NmqiEnvironment nmqiEnv,NmqiMQ nmqiMQ,XmsPropertyContext connectProps)位于 IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateV7ProviderConnection(XmsPropertyContext connectionProps)
Linked Exception : System.ComponentModel.Win32Exception (0x80004005): Access is denied at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly) at System.Diagnostics.ProcessManager.GetModuleInfos(Int32 processId)
at System.Diagnostics.Process.get_Modules() at IBM.WMQ.CommonServices.TraceEnvironment() at IBM.WMQ.CommonServices.CreateCommonServices() at IBM.WMQ.CommonServices.TraceEnabled() at IBM.WMQ.MQBase..ctor()
at IBM.WMQ.Nmqi.Phconn..ctor(NmqiEnvironment env) at IBM.WMQ.Nmqi.NmqiEnvironment.NewPhconn() at IBM.XMS.Client.WMQ.WmqConnection..ctor(NmqiEnvironment nmqiEnv, NmqiMQ nmqiMQ, XmsPropertyContext connectProps) at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateV7ProviderConnection(XmsPropertyContext connectionProps)
推荐答案
被模拟的用户ID似乎没有足够的权限,并且XMS也不存在问题.
Looks like the user id being impersonated does not have enough permissions and not a problem with XMS.
这里的链接可能会对您有所帮助.
Here is a link that may be of help to you.
在System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo中拒绝访问startInfo)
和此
and this also.
这篇关于可以在本地进行模拟,但不能在服务器上进行模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!