Author |
Message
|
Ravee |
Posted: Tue Sep 07, 2004 12:28 pm Post subject: Weird behavior when running my mq client app as NT Service |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Hi,
I am in the process of converting an existing legacy system which is running as an DOS application (VC++ 6.0 and MQ 5.1 client libraries) connecting to the queue on the mainframe, into a NT Based service.
The service app runs only when I am running it in debug mode. When I start my services (using control panel / net start <svcapp>), it has problem loading and initializing the app. It gives an error "Application failed to initialize 0xC0000022.
However, if I comment out MQ related code and delink the IMQ libs, it gets loaded and runs properly.
I am in a bind as not to redo whole set of classes for the implemented design and also with the time frame I am working with.
Has anybody ever had any related incidents with the imq client libs running as NT service or such error occuring in the past. If so, could you please point me in the right direction or share your experience of fixing it.
Thanks in advance for your time, it is deeply appreciated.
Ravee. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 07, 2004 12:43 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What user is the service being run by?
This might be an authentication issue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Ravee |
Posted: Wed Sep 08, 2004 1:46 am Post subject: |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Hi Jeff,
Sorry I forgot to mention those. The service is running in the local system account context. I tried it without and with the "Desktop Interactive" setting enabled, still got the same behavior.
Thanks
Ravee. |
|
Back to top |
|
 |
JasonE |
Posted: Wed Sep 08, 2004 2:24 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Is the MQ bin directory on the SYSTEM wide path (not the user one), ie can your service actually load the amq*.dll files? |
|
Back to top |
|
 |
Ravee |
Posted: Wed Sep 08, 2004 7:24 am Post subject: |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Hi Jason,
The MQSeries Bin is in the SYSTEM PATH and not in the USER PATH.
Ravee. |
|
Back to top |
|
 |
JasonE |
Posted: Wed Sep 08, 2004 7:28 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Thoughts...
1. Try turning on trace, then net start your service - do you get a trace file created for your service app, and if so how far does it get
2. Try running regmon and filemon while net starting your service - any obvious errors listed? Check for amq* being loaded from anywhere other than the bin dir as well, in the filemon output |
|
Back to top |
|
 |
Ravee |
Posted: Wed Sep 08, 2004 7:47 am Post subject: |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Jason,
I have tried the Trace, and the control didn't even hit the main. The app bummed out while loading all the dependants.
Let me try the Regmon and FileMon and will post my findings.
As far as multiple copies of amq*.dll being present on the system, I have confirmed that there is only one copy existing which is in the system path. |
|
Back to top |
|
 |
Ravee |
Posted: Wed Sep 08, 2004 8:40 am Post subject: |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Jason,
The FileMon was a great Idea... Thanks a ton. Even though the MQ\Bin is in the SYSTEM PATH variable, it is not getting looked up in that folder. I think I might have to make sure of that and do a reboot and try running it again.
Will post an update as I find out why even though the control panel system applet shows the folder in the path, it is being recogonised.
Thanks again Jason and all
Ravee. |
|
Back to top |
|
 |
JasonE |
Posted: Wed Sep 08, 2004 8:45 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Probably you havent rebooted since installing
The env for a service comes from scm.exe (the service control manager) and this does not change its environment when the panels update the system path. Hence the **only** way to get new environment changes to impact a service is a reboot |
|
Back to top |
|
 |
Ravee |
Posted: Wed Sep 08, 2004 9:08 am Post subject: Problem Solved... Many Thanks |
|
|
 Newbie
Joined: 28 Oct 2002 Posts: 9 Location: New York, NY
|
Jason,
You were right on the money as to the path variable. The s/w were installed long ago, but some recent installations have added much to the system path variable. My guess is it must have execeeded the max limit. So the mq bin path was not visible. I cleaned out most of the folders from the path, it started working fine.
Now I gotta get the app calling the queue and hope the MQOO_WAIT option to get a message will not block my other thread which is listening on the WinSock.
Thanks again for yours and others help
Ravee
 |
|
Back to top |
|
 |
|