starting tomcat thru ant causes connection refused

Discussion in 'Java' started by harryos, Nov 18, 2008.

  1. harryos

    harryos Guest

    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
     
    harryos, Nov 18, 2008
    #1
    1. Advertising

  2. harryos

    Jan Thomä Guest

    On 2008-11-18 05:40:54 +0100, harryos <> said:

    > 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
     
    Jan Thomä, Nov 18, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gaurav tyagi
    Replies:
    0
    Views:
    5,087
    gaurav tyagi
    Mar 18, 2006
  2. Chris Bedford
    Replies:
    6
    Views:
    2,288
  3. sCHL
    Replies:
    1
    Views:
    573
    Patrick Meuser
    Aug 26, 2003
  4. THTB
    Replies:
    0
    Views:
    217
  5. Max Williams
    Replies:
    3
    Views:
    191
    Robert Klemme
    Jan 6, 2009
Loading...

Share This Page