Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Restart COM+ service from command line

4,929 views
Skip to first unread message

Pravin Wilfred

unread,
Sep 16, 2003, 5:52:05 PM9/16/03
to
Hi, can anyone help? How do you restart a COM+ component
from the command line. The reason I need to do this is to
automate the restart if the component hangs. Please help
me out. Thanks. Pravin

Slava Gurevich

unread,
Sep 17, 2003, 12:59:47 AM9/17/03
to
Hi,

You cannot shut down an individual object per se, but you can shut
down the process it lives in, aka the COM+ Server Application. There
is no need to restart it, unless the COM+ application is marked as
Queued, in which case just add the following after the
"ShutdownApplication" line to the script below:
oCatalog.StartApplication "YourCOM+AppName" 'case sensitive


Make a text file called, say, shutdown.vbs
----------------------------------------------------------------------------------------------------
dim oCatalog
set oCatalog= CreateObject("COMAdmin.COMAdminCatalog")
oCatalog.ShutdownApplication "YourCOM+AppName" 'case sensitive
set oCatalog= nothing

----------------------------------------------------------------------------------------------------

Then from command line run:

wscript shutdown.vbs


Regards,

Slava Gurevich

Don Miller

unread,
Sep 17, 2003, 8:45:17 AM9/17/03
to
Just curious exactly how one would automate a command line command to
shutdown a COM+ app. If my error trapping code came up with a particular
error (ASP 0177), then how would I call a command line? Couldn't I just put
your example vbs code in the error trapping (as long as it wasn't in a COM+
component because my ASP without components still functions)?

This comes up for me because apparently no one has an answer for my post
"COM+ Hosed with Concurrent Calls to Crystal?" and I can't be around all the
time to shutdown COM+ when it happens.

Thanks.


"Slava Gurevich" <vy...@hotmail.com> wrote in message
news:5tpfmv0eos40l79vo...@4ax.com...

Slava Gurevich

unread,
Sep 17, 2003, 9:25:50 AM9/17/03
to
Hi Don,

You should be able to just integrate the code directly into your ASP
script.

As to the issue with Crystal reports, I am not an expert in Crystal
reports, but in my opinion it's not a good idea to use that with COM+
in the first place. Crystal reports component could pop modal dialog
boxes to the invisible desktop in COM+ with no one there to dismiss it
thereby causing what looks like a hang.

Is it possible that the Crystal component is trying to display a
dialog complaining of insufficient concurrent licenses? Have you
checked the Event Log to see if anything related is logged there?

Just for debugging you could try and set the COM+ App. identity to
"interactive user" while being logged on interactively, and see if any
Crystal GUI dialogs pop up under load test.

Perhaps you should also try posting to microsoft.public.vb.crystal to
see if you could get another opinion or more info about this.


Regards,

Slava Gurevich

On Wed, 17 Sep 2003 07:45:17 -0500, "Don Miller" <nos...@nospam.com>
wrote:

Don Miller

unread,
Sep 17, 2003, 9:56:19 AM9/17/03
to
I appreciate your thoughts and help. My comments below.

> Crystal reports component could pop modal dialog
> boxes to the invisible desktop in COM+ with no one there to dismiss it
> thereby causing what looks like a hang.

There's an option in the coding that prevents dialogs from popping up (but
maybe not error messages?). But would that trash the COM+ application so
that every Server.CreateObject("fooComponent") fails?

I've used the Crystal Report for 3 years without problem, just for the first
time the other day, two people used it at once :( I'm lucky though, at
least I've recreated the problem on my dev server. Just no clues yet.

> Is it possible that the Crystal component is trying to display a
> dialog complaining of insufficient concurrent licenses?

Good thought. I have a license (developer) for 5 concurrent accesses and I
can recreate the problem with under 5 accesses. I'll have to look into this
but my error trapping has always reported Crystal errors before (e.g.
"Server not opened", "Report File in use", etc.). I don't know where else
license issues would appear.

> Have you
> checked the Event Log to see if anything related is logged there?

Nothing. No cautions or warnings.


> Just for debugging you could try and set the COM+ App. identity to
> "interactive user" while being logged on interactively, and see if any
> Crystal GUI dialogs pop up under load test.

My dev machine is interactive, prod of course is not.

> Perhaps you should also try posting to microsoft.public.vb.crystal to
> see if you could get another opinion or more info about this.

Didn't know there was one. Thanks.


Klaus H. Probst

unread,
Sep 17, 2003, 11:46:13 PM9/17/03
to

"Slava Gurevich" <vy...@hotmail.com> wrote in message
news:rkmgmvkulv6n9cpr8...@4ax.com...

> You should be able to just integrate the code directly into your ASP
> script.

Shutting down a running COM+ app requires admin rights or membership in one
of the groups in the System Application, so my guess is that if he's running
under IUSR_* that will fail. Well, it *should* fail =)

The few times I've needed to do this I've done it from another COM+ app
running under an identity configured with said permissions, then called from
an ASP page.


--
____________
Klaus

Slava Gurevich

unread,
Sep 18, 2003, 6:34:03 AM9/18/03
to
Klaus, You're right of course; thanks for pointing that out

Slava Gurevich

0 new messages