You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Jeff Barrett <jb...@finaplex.com> on 2004/08/20 03:34:34 UTC

ant integration and starting/stoping container w/ ant tasks

I'm having a conceptual problem here, or at least I think I am.  The 
tasks I seem to need to automate testing with cactus and ant (e.g. 
<cactus> or <runservertests>) require me to specify what tasks to call 
to start and stop the server.  I have one task that starts the server, 
but it just calls a java ant task.  Let's call it weblogic-start.

These other tasks could certainly call weblogic-start no problem.  But, 
as far as I understand it, the thread of control wouldn't return from 
the call to weblogic-start since it hangs around as long as the server 
is running.  Control would never return to the <cactus> or 
<runservertests> tasks so that they could then run the tests.

Assuming I'm right about this, I'm guessing I would need the ant task 
that starts the server to call some script that will start the server 
but detach control from it.  Any ideas how to do that?  I'm working on a 
windows machine -- is there some way I can maybe startup weblogic as a 
windows service from an ant task?

Thanks.


Re: ant integration and starting/stoping container w/ ant tasks

Posted by Be...@urz.uni-hd.de.
Hi Jeff,

may this is possible (I am doing it with ATG Dynamo):
If your weblogic-server is installed as a service you can use net start/stop 
with a short workaround. Either you can write a batch file which contains 
something like that:

sc \\my-remote-server start myService
or
rem Be aware that netsvc returns 1 if everything went well and not 0
netsvc myService \\my-remote-server start

Than. you can run the batch file with the exec task.

Cheers,
Jens

PS: If you need the netsvc.exe from the resource kit, I can mail you this one.

Zitat von Jeff Barrett <jb...@finaplex.com>:

> I'm having a conceptual problem here, or at least I think I am.  The 
> tasks I seem to need to automate testing with cactus and ant (e.g. 
> <cactus> or <runservertests>) require me to specify what tasks to call 
> to start and stop the server.  I have one task that starts the server, 
> but it just calls a java ant task.  Let's call it weblogic-start.
> 
> These other tasks could certainly call weblogic-start no problem.  But, 
> as far as I understand it, the thread of control wouldn't return from 
> the call to weblogic-start since it hangs around as long as the server 
> is running.  Control would never return to the <cactus> or 
> <runservertests> tasks so that they could then run the tests.
> 
> Assuming I'm right about this, I'm guessing I would need the ant task 
> that starts the server to call some script that will start the server 
> but detach control from it.  Any ideas how to do that?  I'm working on a 
> windows machine -- is there some way I can maybe startup weblogic as a 
> windows service from an ant task?
> 
> Thanks.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
> 




RE: ant integration and starting/stoping container w/ ant tasks

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Jeff,

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Jeff Barrett
> Sent: vendredi 20 août 2004 03:35
> To: cactus-user@jakarta.apache.org
> Subject: ant integration and starting/stoping container w/ ant tasks
> 
> I'm having a conceptual problem here, or at least I think I am.  The
> tasks I seem to need to automate testing with cactus and ant (e.g.
> <cactus> or <runservertests>) require me to specify what tasks to call
> to start and stop the server.  I have one task that starts the server,
> but it just calls a java ant task.  Let's call it weblogic-start.
> 

If you're using WL you may be able to use the existing <weblogic7x> nested
element.

> These other tasks could certainly call weblogic-start no problem.  But,
> as far as I understand it, the thread of control wouldn't return from
> the call to weblogic-start since it hangs around as long as the server
> is running.  Control would never return to the <cactus> or
> <runservertests> tasks so that they could then run the tests.

Then you would run it inside a <parallel> Ant task! Something like:

<parallel>
  <antcall target="weblogic-start"/>
  <sequential>
    <wait ...>
    [Do whatever you need to do here]
  </sequential>
</parallel>

> 
> Assuming I'm right about this, I'm guessing I would need the ant task
> that starts the server to call some script that will start the server
> but detach control from it.  Any ideas how to do that?  I'm working on a
> windows machine -- is there some way I can maybe startup weblogic as a
> windows service from an ant task?

That would be way too complex compared to the sequential task.

-Vincent