| Author | Message | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Fri Nov 12, 2004 10:05 am Post subject: Another MQRC_ENLISTMENT_ERROR in .NET |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| I'm developing a server program which should process incoming messages in a transaction. On my Windows XP client everything works fine. However, as soon as I move the program to a windows 2003 server, the program crashes with a "MQRC_ENLISTMENT_ERROR" error.  No matter wich options I change in the DTC, nothing works. 
 I created a very small program with the minimum code to send a message in a transaction:
 
 
 
   
	| Code: |  
	| using System;
 using System.EnterpriseServices;
 using IBM.WMQ;
 
 namespace MQDTC
 {
 [Transaction]
 public class MQDTCTest : ServicedComponent
 {
 [AutoComplete]
 private void PostOneMessage(string qmn, string qn, string m) {
 MQQueue q = new MQQueueManager(qmn).AccessQueue(qn, MQC.MQOO_OUTPUT);
 MQPutMessageOptions mpo = new MQPutMessageOptions();
 mpo.Options = MQC.MQPMO_SYNCPOINT;
 MQMessage message = new MQMessage();
 message.Format = MQC.MQFMT_STRING;
 message.WriteString(m);
 q.Put(message, mpo);
 q.Close();
 }
 
 [STAThread]
 static void Main(string[] args)
 {
 if (args.Length == 3) {
 try {
 new MQDTCTest().PostOneMessage(args[0], args[1], args[2]);
 } catch (MQException mqe) {
 Console.WriteLine("MQException thrown: " + mqe.Message);
 Console.WriteLine("  Completion code: " + mqe.CompletionCode);
 Console.WriteLine("  Reason(code): " + mqe.Reason + "(" + mqe.ReasonCode + ")");
 Console.WriteLine("  Source: " + mqe.Source);
 Console.WriteLine("  Inner Exception: " + mqe.InnerException.Message);
 }
 } else {
 Console.WriteLine("Usage: MQDTCTest.exe <queue manager> <queue name> <word>");
 }
 }
 }
 }
 
 |  
 The program gives the following output:
 
 
 
   
	| Code: |  
	| C:\> MQDTCTest QM_Bello postcard hi!
 
 MQException thrown: MQRC_UOW_ENLISTMENT_ERROR
 Completion code: 2
 Reason(code): 2354(2354)
 Source: mscorlib
 
 Server stack trace:
 at IBM.WMQ.MQQueue.Put(MQMessage message, MQPutMessageOptions pmo)
 at MQDTC.MQDTCTest.PostOneMessage(String qmn, String qn, String m)
 at System.Runtime.Remoting.Messaging.Message.Dispatch(Object target, Boolean fExecuteInContext)
 at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
 
 Exception rethrown at [0]:
 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
 at MQDTC.MQDTCTest.PostOneMessage(String qmn, String qn, String m)
 at MQDTC.MQDTCTest.Main(String[] args)
 
 |  
 Does anyone have any idea how I can make this work?
 
 Thanks in advance,
 Henk-Jan.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kirani | 
			  
				|  Posted: Fri Nov 12, 2004 10:52 am Post subject: |   |  | 
		
		  | Jedi Knight
 
 
 Joined: 05 Sep 2001Posts: 3779
 Location: Torrance, CA, USA
 
 | 
			  
				| From WMQ manual .. 
 
   
	| Quote: |  
	| 2354: MQRC_UOW_ENLISTMENT_ERROR
 This reason code can occur for a variety of reasons. The most likely reason is that an object created by a DTC transaction does not issue a transactional MQI call until after the DTC transaction has timed out. (If the DTC transaction times out after a transactional MQI call has been issued, reason code MQRC_HANDLE_IN_USE_FOR_UOW is returned by the failing MQI call.)
 Another cause of MQRC_UOW_ENLISTMENT_ERROR is incorrect installation; Windows NT Service pack must be installed after the Windows NT Option pack.
 This reason code occurs only on Windows.
 Corrective action: Check the DTC “Transaction timeout” value. If necessary, verify the NT installation order.
 
 |  _________________
 Kiran
 
 
 IBM Cert. Solution Designer & System Administrator - WBIMB V5
 IBM Cert. Solutions Expert - WMQI
 IBM Cert. Specialist - WMQI, MQSeries
 IBM Cert. Developer - MQSeries
 
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Fri Nov 12, 2004 11:53 am Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| Kiran, thanks for the very fast response. 
 But alas it didn't really help. As I'm not using Windows NT I assume it should be the first reason.
 
 I have no idea why my object does not issue a transactional MQI call in time.
 
 To be honest, I have no idea what transactional MQI call is and how I should issue it.
 
 I just used the information from the "WebSphere MQ Solutions in a Microsoft .NET Environment" Redbook, they don't mention transactional MQI calls.
 
 Is this someway I can fix in my example program? If so, how?
 
 Another remark: when I run the AMQTSIVT.exe test program, the following errors are listed in the logfile:
 
 
 
   
	| Code: |  
	| 20:47:35 Install IVT MTS Component, OK
 20:47:35 Set transactionality to REQUIRED, Error 0x80070057"The parameter is incorrect.
 "
 20:47:36 Starting Balance is 0.000000
 20:47:36 Incrementing Account Test MQSeries Only - COMPLETEFailed: Not in transaction, Error 0x80004005"Unspecified error
 "
 20:47:36 End Balance is 0.00, (MQ = 0.00), FAILED
 -> DBUpdated: No; MQUpdated No
 20:47:36 Starting Balance is 0.000000
 20:47:36 Incrementing Account Test MQSeries Only - ABORTFailed: Not in transaction, Error 0x80004005"Unspecified error
 "
 20:47:36 End Balance is 0.00, (MQ = 0.00), PASSED
 20:48:53 Cleaning Up...
 20:48:53 Deleting MTS Package
 
 |  
 So, if anyone has any suggestion, I would be very grateful.
 
 Greetings,
 Henk-Jan.
 
 BTW: mqe.StackTrace should have been of mqe.InnerException in the example given above.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Fri Nov 12, 2004 2:30 pm Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| Could it be that you are binding with a version of the dll that does not support 2 phase commit ? 
 Remember late binding in C#...
 
 Hope it helps
  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Fri Nov 12, 2004 2:34 pm Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| FJB, 
 Is there any way I can find out?
 
 Is this consistent with the fact that it runs smoothly under XP but not under Windows 2003 Server?
 
 Greetings,
 Henk-Jan.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Fri Nov 12, 2004 2:38 pm Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| You have to remember that there are a few flavors to MQ. 
 a) MQ Server with the dlls for 2 phase commit
 b) MQ client  no 2 phase commit
 c) MQ Transactional client with 2 phase commit (extra license needed)
 
 Now as to which is the right dll to use in your build ... read the .Net documentation...
 
 Hope it helps
  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Fri Nov 12, 2004 2:49 pm Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| FJB, 
 Thanks, I will (first thing when I'm back in the office again). Although I'm only linking against (something like) amqmdnet.dll, I assume the installation will determine which version of websphere will be used.
 
 Henk-Jan.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JasonE | 
			  
				|  Posted: Sun Nov 14, 2004 2:00 pm Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 03 Nov 2003Posts: 1220
 Location: Hursley
 
 | 
			  
				| The amqtsivt is broken on win2003 due to o/s 'changes' which break backward compatibility. It isnt related to your current problem (I think...) |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Sun Nov 14, 2004 2:18 pm Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| Too bad, otherwise I could just concentrate on fixing the amqtsivt program, now I stil have to get my own program running. 
 Could it have something to do with permissions? My network adminstrator refuses to set up an account in my test environment which can access AD, but as it seems to run fine on Windows XP I assume this ain't the problem.
 
 However, I noticed that the Distibuted Transaction Coordinator service on my Windows XP machine logs on as local administrator, on Windows 2003 it logs on as NT AUTHORITY\NetworkService. Could this have anything to do with the MQRC_UOW_ENLISTMENT_ERROR error?
 
 Greetings,
 Henk-Jan.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JasonE | 
			  
				|  Posted: Mon Nov 15, 2004 7:51 am Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 03 Nov 2003Posts: 1220
 Location: Hursley
 
 | 
			  
				| I really dont know, sorry. I do know that MQ cant handle the network service userid BUT you should see different errors to what you are getting. It would be a case of cutting it down to a simple test program and if it still fails work through a trace - your best bet is to report it through IBM service (Sorry - I dont have time at the moment to look through it as its quite a complex area). |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Thu Nov 18, 2004 5:24 am Post subject: Solution |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| We finally we found the solution to this problem. It is a known problem listed at the IBM website and has to do with third-party XA DLLs in the MS DTC process. (I still don't understand why this page doesn't show up in search engines). 
 It can be solved by adding the following key to the registry.
 
 
 
   
	| Code: |  
	| HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL
 amqmtsxatm.dll = C:\Program Files\IBM\MQSeries\bin\amqmtsxatm.dll
 
 |  
 For more information see:
 
 http://www-1.ibm.com/support/docview.wss?rs=171&context=SSFKSJ&q1=XA+DTC&uid=swg21159392&loc=en_US&cs=utf-8?=en
 
 Greetings and thanks for all the help,
 Henk-Jan.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JasonE | 
			  
				|  Posted: Thu Nov 18, 2004 6:40 am Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 03 Nov 2003Posts: 1220
 Location: Hursley
 
 | 
			  
				| Wow thanks - I had never heard of that! Thanks for posting the solution |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jefflowrey | 
			  
				|  Posted: Thu Nov 18, 2004 7:07 am Post subject: |   |  | 
		
		  | Grand Poobah
 
 
 Joined: 16 Oct 2002Posts: 19981
 
 
 | 
			  
				| You know, it sure would be nice if that IBM support note clearly indicated that you need to adjust the path in that Registry Entry to point to your install directory. _________________
 I am *not* the model of the modern major general.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Henk-Jan Visscher | 
			  
				|  Posted: Thu Nov 18, 2004 7:17 am Post subject: |   |  | 
		
		  | Novice
 
 
 Joined: 12 Nov 2004Posts: 10
 Location: Amsterdam
 
 | 
			  
				| Yep, you're right (of course our installation differed from the default location). But it would be even nicer if IBM would let search engines index their support pages, would have saved me a couple of days. |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | JasonE | 
			  
				|  Posted: Thu Nov 18, 2004 7:27 am Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 03 Nov 2003Posts: 1220
 Location: Hursley
 
 | 
			  
				| Dont quote me, but I heard rumours that is being organized... |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |