You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by nicolae claudius <ni...@yahoo.com> on 2009/09/08 16:24:22 UTC

Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

I have made an windows service that uses qpid client libraries to comunicate with a server.
The service uses WMI to gather station usage information and send it to an upstream server.

I noticed that any windows service that uses qpid client libraries and simultaneously calls CoInitializeEx(...) to initialize and use COM fails to start as windows service with the following error:

Error 1053: The service did not respond to the start or control request in a timeley fashion

Anyone has some advice on this ?



      

RE: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

Posted by David Ingham <Da...@microsoft.com>.
One of my Microsoft colleagues, Max Feingold, had some ideas...

-----Original Message-----
From: Max Feingold 
Sent: Monday, September 14, 2009 6:45 PM
Subject: RE: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

A few thoughts…  None authoritative, but based on some years of experience working in Windows. 

There are a number of things one should not do in a ServiceMain.  Most can be summarized as “don’t take too long”.

Among things that can take too long, starting another service is the canonical example - since the SCM is waiting for you, it won’t start the other service until you’re done.  Instant deadlock.

Sometimes you just do a lot of work on startup – no deadlock required.  In that case “we need more time” should really be “defer work until later”.  So if you do need to do something long-running during service start, don’t.  If you really, really need to, you should make sure to call SetServiceStatus with SERVICE_START_PENDING, frequently.  This then gives you the job of doing hang detection yourself, which is no fun.

Further, you need to remember that if your service is set to autostart, you will start up with the OS.  This means that lots of stuff may not yet be initialized, or may be initializing in parallel with you.  If you have a dependency on any such things (i.e. other services), you need to declare a dependency explicitly in your service configuration.

CoInitializeEx is one of those things that IIRC may cause another service to be started (rpcss and dcomlaunch, specifically).  So if it’s going to be used during ServiceMain, these dependencies should be called out explicitly.  Similarly, any WMI work done in ServiceMain may require specific service dependencies to be declared.

And with all this said, there’s no better way to debug this sort of problem than a process dump showing the hang or crash in question.


-----Original Message-----
From: nicolae claudius [mailto:nicolae_claudius@yahoo.com] 
Sent: Tuesday, September 08, 2009 7:27 AM
To: users@qpid.apache.org
Subject: Re: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

This problem is only on Windows Vista, on XP works ok
I have made an windows service that uses qpid client libraries to comunicate with a server.
The service uses WMI to gather station usage information and send it to an upstream server.

I noticed that any windows service that uses qpid client libraries and simultaneously calls CoInitializeEx(...) to initialize and use COM fails to start as windows service with the following error:

Error 1053: The service did not respond to the start or control request in a timeley fashion

Anyone has some advice on this ?


      

Re: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

Posted by nicolae claudius <ni...@yahoo.com>.
This problem is only on Windows Vista, on XP works ok
I have made an windows service that uses qpid client libraries to comunicate with a server.
The service uses WMI to gather station usage information and send it to an upstream server.

I noticed that any windows service that uses qpid client libraries and simultaneously calls CoInitializeEx(...) to initialize and use COM fails to start as windows service with the following error:

Error 1053: The service did not respond to the start or control request in a timeley fashion

Anyone has some advice on this ?


      

Re: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

Posted by nicolae claudius <ni...@yahoo.com>.
yes is only windows services on windows vista where the application fails
( console works OK both on vista and xp but service works only on xp, on vista throws the descripted error)




________________________________
From: Robert Greig <ro...@gmail.com>
To: users@qpid.apache.org
Sent: Tuesday, 8 September, 2009 21:53:04
Subject: Re: Error 1053 when starting any windows service that uses qpid  client + COM CoInitializeEx

2009/9/8 nicolae claudius <ni...@yahoo.com>:

> I noticed that any windows service that uses qpid client libraries and simultaneously calls CoInitializeEx(...) to initialize and use COM fails to start as windows service with the following error:

Is it only windows services that fail, or do other win32 executables
(e.g. a simple console application) also fail?

Thanks,
Robert

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


      

Re: Error 1053 when starting any windows service that uses qpid client + COM CoInitializeEx

Posted by Robert Greig <ro...@gmail.com>.
2009/9/8 nicolae claudius <ni...@yahoo.com>:

> I noticed that any windows service that uses qpid client libraries and simultaneously calls CoInitializeEx(...) to initialize and use COM fails to start as windows service with the following error:

Is it only windows services that fail, or do other win32 executables
(e.g. a simple console application) also fail?

Thanks,
Robert

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org