starting tomcat thru ant causes connection refused

H

harryos

i wrote an ant target to start tomcat manager with url,usrname,passwd
read from a build.properties file.

<property file="build.properties" />

<taskdef name="start" classname="org.apache.catalina.ant.StartTask"
classpath="${tomcat.dir}/lib/catalina-ant.jar" />
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
classpath="${tomcat.dir}/lib/catalina-ant.jar" />

<path id="classpath">
<fileset dir="${tomcat.dir}/lib">
<include name="*.jar"/>
</fileset>
</path>

<target name="init" description ="creating build and dist
directories">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<property name="context-path" value="" />
</target>

<target name="start-tomcat" depends="init">
<start url="${url}" username="${username}" password="${password}"
path="${context-path}"/>
</target>

-------------------
in build.properties file i wrote
tomcat.dir=E:/tomcat/apache-tomcat-6.0.18
url=http://localhost:8080/manager
username=admin
password=admin
---------------------------

when i run 'ant start-tomcat' ,it causes an error '
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method) ,Can
someone help me with this?What do i need to do to get tomcat started?

thanks
harry
 
J

Jan Thomä

org.apache.catalina.ant.StartTask

The task you are using is not for starting tomcat, but for starting an
application inside the tomcat container. Therefore in order for this
task to be successful, tomcat needs to be already running. Also the
manager application must already be deployed inside tomcat, so this
task can connect to it. I assume that tomcat is not running, therefore
you are getting the "connection refused" error.

Best regards,
Jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top