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 Kevin Murdoff <KM...@dfg.ca.gov> on 2005/10/11 17:02:27 UTC

Running from Ant

Greetings All -

I'm hoping someone can help clear something up for me?

Is there a way of running the <cactus> Ant task without causing Tomcat to startup and shutdown with each Ant run?

I read in the docs that the <containerset> won't start and stop Tomcat if it is already running, but when I use it with a port of 8080, it complains (obviously) that port 8080 is already bound.  No doubt by my existing Tomcat instance.

However, when I change the port to say 55555, none of my tests succeed.  The test classes could not be loaded by the Context and web apps class loaders.

How, if I already have Tomcat running, can I use the <cactus> task to automate my testing?  Or is there another task?

My environment includes the following:
- Java 1.4.2
- Ant 1.6.2
- Cactus 1.6.1
- Tomcat 4.1.30

Many thanks!

- KFM

Kevin F. Murdoff
Calif. Dept. of Fish & Game




Re: Running from Ant

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi,

In article <s3...@dfg.ca.gov>,
Tue, 11 Oct 2005 08:02:27 -0700,
"Kevin Murdoff" <KM...@dfg.ca.gov> wrote: 
KMURDOFF> I read in the docs that the <containerset> won't start and stop
KMURDOFF> Tomcat if it is already running, but when I use it with a port of
KMURDOFF> 8080, it complains (obviously) that port 8080 is already bound.
KMURDOFF> No doubt by my existing Tomcat instance.

AFAIK, to know whether a container is already running,
<cactus> task accesses to ServletRedirector of the target contextURL
and checks its response status. In other words, <cactus> task checks
whether the target cactified application is available.
So, you need to deploy the cactified application
prior to the <cactus> task call.


KMURDOFF> However, when I change the port to say 55555, none of my tests succeed.
KMURDOFF> The test classes could not be loaded by the Context and web apps class loaders.

If you only changed the port attribute of the tomcat5x element
in your build.xml, that may be not enough. You need to provide
a server configuration file (server.xml) for the new server instance.
In your use case, I think, the server.xml, which has been configured
for the existing server instance, has conflicting conditions
that cause the start up of the new server to be failed.
<tomcat5x> task uses ${directory specified by dir attr}/conf/server.xml
to start up the new server by default, but you can change it
by using serverxml attribute.

Be sure that all ports the new server will listen to are not in use
by the existing server, 8005 and 8080 for examples.

Hope this helps,
----
Kazuhito SUGURI