tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bjørge Solli <bjorge.so...@nersc.no>
Subject Re: restart servlet from cron
Date Tue, 27 Dec 2005 10:25:19 GMT
Bjørge Solli wrote:
> rusty+tomcat@grunt.berkeley.edu wrote:
> 
>> Here's what's in one of my ant files to stop a web app.  Start and 
>> restart are probably similar.
>>
>> <taskdef name="tc-stop" classname="org.apache.catalina.ant.StopTask" />
>> <target name="tomcat-stop">
>>    <tc-stop
>>        url="http://myhost.mycompany.com/manager/"
>>        username="manager"
>>        password="managerpw"
>>        path="/${webapp}"
>>    />
>> </target>
> 
> 
> Thankyou. I am new to ant and cannot understand this error I get when I 
> run your example (changed the variables though):
> 
> Buildfile: build.xml
> 
> BUILD FAILED
> /home/bjorges/test/build.xml:1: Unexpected element "taskdef" taskdef
> 
> Total time: 0 seconds
> 
> For me it seems to be expecting some starttag or something. I know this 
> must be somewhat basic, so my guess is I am missing some understanding 
> of the xml-file. I did try to add a '<?xml version="1.0"?>' at the top, 
> but it did not change the error.
> 
> All help appreciated!

Ah, I just needed the project-tag surrounding the rest. Knew it was 
something really simple.

My file now looks like this:
<?xml version="1.0"?>
<project>
<property name="catalina-ant.jar"
   location="/usr/share/java/catalina5-ant.jar"/>
<taskdef name="tc-stop" classpath="${catalina-ant.jar}" 
classname="org.apache.catalina.ant.StopTask" />
<target name="tomcat-stop">
    <tc-stop
        url="http://myserver.com:8080/manager/"
        username="user"
        password="pw"
        path="/myapp"
    />
</target>
</project>

But still I get this error:
BUILD FAILED
/home/bjorges/test/build.xml:5: taskdef class 
org.apache.catalina.ant.StopTask cannot be found

Where should ant find this? How should I update the classpath accordingly?

thanks

-- 
Bjørge Solli - Private cellphone: +47 91614343
Nansen Environmental and Remote Sensing Center - Bergen
http://www.nersc.no Reception: +47 55205800
Dept.: Mohn-Sverdrup Center for Global Ocean Studies
        and Operational Oceanography

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message