David,

according to Javadocs[1] Start ant task implements the
/start command, supported by the Tomcat manager
application. Then from manager docs[2] we read that
/start command Signal a stopped application to
restart, and make itself available again...

For starting and stopping the vary Tomcat see [3]

HTH Ivan

[1]http://jakarta.apache.org/tomcat/tomcat-5.0-doc/catalina/docs/api/org/apache/catalina/ant/StartTask.html
[2]http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Start%20an%20Existing%20Application
[3]http://marc.theaimsgroup.com/?l=ant-user&m=108693683708999&w=2
--- David <[EMAIL PROTECTED]> wrote:

> Dear Members,
>  
> I am trying to interact with the Tomcat server
> throught ant, it works for me for the list command,
> but I can't start or stop the server.
>  
> I am using the following target invocation:
>  
> <target name = "start"
>   description = "Start Tomcat application"
>   >
>   <start
>     url         = "http://localhost:8080/manager";
>     username    = "admin"
>     password    = "tomcat"
>     path        = "/springapp"
>     />
> </target>
>  
> I have installed jdk 1.4.2_07 and also java runtime
> 1.5 for Tomcat 5.5. Tomcat requires at least a java
> runtime time 1.5.
>  
> If I execute after staring the server manually the
> list task it works,  but start and stop commands
> don't work.
>  
> 1. Do I have to use jdk 1.5 with Tomcat 5.5? During
> the Tomcat installation I have selected a 1.5
> runtime version, but I don't have installed the 1.5
> jdk, I am using 1.4.2
>  
> 2. Do I have to use a previous version of tomcat?
>  
> 3. Is there any way to say during the ant execution
> that it should invoke the tomcat tasks assuming
> another runtime versions?
>  
> 
>  
> After running this target on verbose mode I get the
> following output:
>  
>
==================================================================
> Detected Java version: 1.4 in: C:\Java\j2sdk\jre
> Detected OS: Windows 2000
> parsing buildfile P:\springapp\build.xml with URI =
> file:///P:/springapp/build.xml
> Project base dir set to: P:\springapp
> Importing file properties.xml from
> P:\springapp\build.xml
> parsing buildfile P:\springapp\properties.xml with
> URI = file:///P:/springapp/properties.xml
>  [property] Loading C:\Documents and
> Settings\UF367151\springapp_build.properties
> Property ${user.properties.file} has not been set
>  [property] Loading
> P:\springapp\${user.properties.file}
>  [property] Unable to find property file:
> P:\springapp\${user.properties.file}
>  [property] Loading P:\springapp\build.properties
> Override ignored for property junit.printsummary
> Override ignored for property junit.fork
> Override ignored for property junit.showoutput
> Override ignored for property junit.haltonfailure
> Override ignored for property junit.formatter.type
> Override ignored for property
> junit.formatter.usefile
> Importing file taskdef.xml from
> P:\springapp\build.xml
> parsing buildfile P:\springapp\taskdef.xml with URI
> = file:///P:/springapp/taskdef.xml
>  [property] Loading P:\springapp\messages.properties
> Build sequence for target `start' is [start]
> Complete build sequence is [start, undeploy,
> load-data, compile, build, deploy, drop-tables,
> show-properties, junit-do, print-properties,
> install, stop, reload, clean, usage, help, init,
> list, clear-data, print-data, junit, create-tables,
> deploywar, ]
> start:
> BUILD FAILED
> P:\springapp\build.xml:236:
> java.net.ConnectException: Connection refused:
> connect
>  at
>
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:261)
>  at
>
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:145)
>  at
>
org.apache.catalina.ant.StartTask.execute(StartTask.java:71)
>  at
>
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>  at org.apache.tools.ant.Task.perform(Task.java:364)
>  at
> org.apache.tools.ant.Target.execute(Target.java:341)
>  at
>
org.apache.tools.ant.Target.performTasks(Target.java:369)
>  at
>
org.apache.tools.ant.Project.executeTarget(Project.java:1214)
>  at
>
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
>  at
> org.apache.tools.ant.Main.runBuild(Main.java:673)
>  at
> org.apache.tools.ant.Main.startAnt(Main.java:188)
>  at
>
org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>  at
>
org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> Caused by: java.net.ConnectException: Connection
> refused: connect
>  at java.net.PlainSocketImpl.socketConnect(Native
> Method)
>  at
>
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>  at
>
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>  at
>
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>  at java.net.Socket.connect(Socket.java:452)
>  at java.net.Socket.connect(Socket.java:402)
>  at
>
sun.net.NetworkClient.doConnect(NetworkClient.java:139)
>  at
>
sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
>  at
>
sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
>  at
>
sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
>  at
>
sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:339)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:320)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:315)
>  at
>
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
>  at
>
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
>  at
>
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:202)
>  ... 12 more
> --- Nested Exception ---
> java.net.ConnectException: Connection refused:
> connect
>  at java.net.PlainSocketImpl.socketConnect(Native
> Method)
>  at
>
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>  at
>
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>  at
>
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>  at java.net.Socket.connect(Socket.java:452)
>  at java.net.Socket.connect(Socket.java:402)
>  at
>
sun.net.NetworkClient.doConnect(NetworkClient.java:139)
>  at
>
sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
>  at
>
sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
>  at
>
sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
>  at
>
sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:339)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:320)
>  at
> sun.net.www.http.HttpClient.New(HttpClient.java:315)
>  at
>
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
>  at
>
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
>  at
>
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:202)
>  at
>
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:145)
>  at
>
org.apache.catalina.ant.StartTask.execute(StartTask.java:71)
>  at
>
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>  at org.apache.tools.ant.Task.perform(Task.java:364)
>  at
> org.apache.tools.ant.Target.execute(Target.java:341)
>  at
>
org.apache.tools.ant.Target.performTasks(Target.java:369)
>  at
>
org.apache.tools.ant.Project.executeTarget(Project.java:1214)
>  at
>
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
>  at
> org.apache.tools.ant.Main.runBuild(Main.java:673)
>  at
> org.apache.tools.ant.Main.startAnt(Main.java:188)
>  at
>
org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> 
=== message truncated ===



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to