可以在本地进行模拟,但不能在服务器上进行模拟 [英] Impersonation okay local but not on server

查看:119
本文介绍了可以在本地进行模拟,但不能在服务器上进行模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为我的假冒行为有问题,但我可能会误会.

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:

7765 [20]错误SIS(空)-无法连接到Websphere MQ IBM.XMS.XMSException:CWSMQ0006E:在运行期间接收到异常 调用方法ConnectionFactory.CreateConnection: 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).在执行指定方法期间 另一个组件抛出了异常.查看链接的异常 欲获得更多信息.在 IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateProviderConnection(XmsPropertyContext connectionProps)位于 IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection(String userID,字符串密码)位于 IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection()在 Spin.TradingServices.DataAcquisition.Domain.DataProcessing.SIS.SISMQConnection.Connect(ImpersonationCredentials impersonationCredentials)

7765 [20] ERROR SIS (null) - Unable to connect to Websphere MQ IBM.XMS.XMSException: CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: 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). During execution of the specified method an exception was thrown by another component. See the linked exception for more information. at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.CreateProviderConnection(XmsPropertyContext connectionProps) at IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection(String userID, String password) at IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.CreateConnection() at Spin.TradingServices.DataAcquisition.Domain.DataProcessing.SIS.SISMQConnection.Connect(ImpersonationCredentials impersonationCredentials)

链接的异常: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.

这篇关于可以在本地进行模拟,但不能在服务器上进行模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆