Author |
Message
|
thdfedl |
Posted: Mon Dec 07, 2009 10:40 am Post subject: Error 2012 when launch an MQ application as windows service |
|
|
Newbie
Joined: 07 Dec 2009 Posts: 3
|
Hello everybody,
I 've got a strange pb using MQ .NET API.
i've installed the MQSeries client v6 with the latest Fix 2.0.8.
I'm developping an .net application using MQ .net API (amqmdnet.dll, amqmdxcs.dll).
The application listens permanently to a Queue.
The application works fine as a windows console application.
But when i install this application as a windows service and try to launch it, i get an MQException with reason code 2012.
I've also tried to develop a windows service directly in VS 2005, but i got the same pb.
I was searching and trying all the solutions i found on the net, but nothing works.
Has anyone encountered the same problem ? is there a solution ?
The application bugs on the line code where i instanciate the MQQueueManager.
MQQueueManager mQmg = new MQQueueManager(qManagerName, connectionProperties);
Thanks for any help that you can provide.
thdfedl. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 07, 2009 8:07 pm Post subject: Re: Error 2012 when launch an MQ application as windows serv |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
thdfedl wrote: |
The application bugs on the line code where i instanciate the MQQueueManager.
MQQueueManager mQmg = new MQQueueManager(qManagerName, connectionProperties);
|
What kind of connection are you using? Is the user that runs the service the same as the one running the console app? Does it have the same profile? The same path and so forth? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
thdfedl |
Posted: Tue Dec 08, 2009 12:19 am Post subject: |
|
|
Newbie
Joined: 07 Dec 2009 Posts: 3
|
i'm using a MQC.TRANSPORT_MQSERIES_CLIENT connection.
The user is the "local system account" for the service.
Is there something special i must do with this account ? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Dec 08, 2009 2:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Write a .bat or .com file that configures everything so that your app launches just fine.
Use that to launch your app as a service. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 08, 2009 5:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
thdfedl wrote: |
Is there something special i must do with this account ? |
It's not referencing the client libraries correctly (or at all) the way the "real" user is. You'll need to correct the profile for that user; personally I'd create a new "real" user for the application to use because I've never had much luck getting this to work as that local user.
This method yields a variety of other challenges - security, passwords, non-generic user used generically, etc, etc. Speak to your site security people and see which they dislike least.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
thdfedl |
Posted: Tue Dec 08, 2009 5:48 am Post subject: |
|
|
Newbie
Joined: 07 Dec 2009 Posts: 3
|
Vitor wrote: |
It's not referencing the client libraries correctly (or at all) the way the "real" user is. You'll need to correct the profile for that user; personally I'd create a new "real" user for the application to use because I've never had much luck getting this to work as that local user.
This method yields a variety of other challenges - security, passwords, non-generic user used generically, etc, etc. Speak to your site security people and see which they dislike least.  |
I've installed the two libraries amqmdnet.dll and amqmdxcs.dll in the GAC.
I've tried to reference them in the GAC and directly in C:\Program files\IBM\WebSphere MQ\bin but i've got the same result.
I've created a specific user for the service with same profile as the user that launch the console app but i've got the same problem.
This problem is very strange.
 |
|
Back to top |
|
 |
|