How to Deploy a Directory or WAR in TOMCAT6 using ANT?

Posted by Hitesh on Server Fault See other posts from Server Fault or by Hitesh
Published on 2013-06-25T09:42:35Z Indexed on 2013/06/25 10:22 UTC
Read the original article Hit count: 538

Filed under:
|
|
|
|

I want to deploy directory which is extraction of .war file using ANT in Tomcat6.

I have build.xml like

    <property name="WAR_PATH" value="E:/18-06-2013/TEST"/>  
    <property name="mgr.context.path"       value="/FOUR"/>
    <property name="url"      value="http://localhost:8080/manager"/>
    <property name="username" value="tomcat"/>
    <property name="password" value="password"/>

   <target name="deploy" description="Install web application" >
  <deploy url="${url}" username="${username}"  password="${password}"                        

path="${mgr.context.path}" war="file:${WAR_PATH}"/>

But when i run the ANT(build.xml) script i get error something like

    java.io.IOException: too many bytes written
     at   sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2632)
     at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65>

Same script work properly when i try to deploy .war file But ANT(build.xml) script not work properly in case directory. I have also try to deploy directory using HTTP command it work properly.

© Server Fault or respective owner

Related posts about tomcat

Related posts about administration