Posted: Fri Jan 20, 2006 8:05 am Post subject: Problem in connecting to MQ while developing a ASP.Net app..
Newbie
Joined: 20 Jan 2006 Posts: 1
Hi
I am trying to build am web application that will place a message on to a queue in the websphere MQ. I am running my web application on localhost and both the .net and websphere MQ are installed on the same system. The problem is I am unable to make connection with the queuemanager in Websphere and the system is throwing an exception.
MQQueueManager qmgr = new MQQueueManager(qmName);int purchasesOptions =MQC.MQOO_INPUT_AS_Q_DEF|MQC.MQOO_OUTPUT;
MQQueue purchaseQ = qmgr.AccessQueue
(purchasesQName,purchasesOptions);
MQMessage pmsg = new MQMessage();
pmsg.WriteUTF("This is a test purchase!");
MQPutMessageOptions pmo = new MQPutMessageOptions();
purchaseQ.Put(pmsg, pmo);
purchaseQ.Close();
qmgr.Disconnect();
Exception
======
Server Error in '/testWebSphere1_1' Application.
Error in the application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: IBM.WMQ.MQException: Error in the application.
Source Error:
Line 59: String purchasesQName = "ESQL_SIMPLE_IN";Line 60: Line 61: MQQueueManager qmgr = new MQQueueManager(qmName);Line 62: int purchasesOptions =MQC.MQOO_INPUT_AS_Q_DEF|MQC.MQOO_OUTPUT;Line 63: MQQueue purchaseQ = qmgr.AccessQueue(purchasesQName,purchasesOptions);
The first thing you need to do is use the proper mechanisms in ASP.NET to Catch the Unhandled Exception.
Then you need to understand that code running in your Application Server is almost always going to run as a different user, with different PATH and other environment variables and different MQ security permissions.
Search here for 2035 and ASP to see a lot of other people who had these same problems. _________________ I am *not* the model of the modern major general.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum