You need to have catalina-ant.jar in your classpath as this jar contains the tasks to manage the tomcat server. you can either copy this jar to the ant/lib directory or use the -lib command-line argument to specify the folder under which it is located. Hope this helps you :) --- On Thu, 3/10/11, Marseld Dedgjonaj wrote: > From: Marseld Dedgjonaj > Subject: antlib.xml could not be found > To: user@ant.apache.org > Date: Thursday, March 10, 2011, 7:39 AM > Hello everybody, > > I am new to Ant and more detailed help would be more > valuable to me. > > I am trying to use Ant to reload a tomcat application. I > write the build.xml > file based on "Managing Applications with Ant" section of > the "Professional > Apache Tomcat" book. > > > > The Build.xml file: > > > > basedir="."> > > > >   > >   value="${basedir}/build"/> > > > >   > >      value="ikub_MainInstance"/> > > > >   > >   value="http://localhost:8080/manager/html"/> > >   > >   value="manager123+"/> > > > >   > >   classname="org.apache.catalina.ant.DeployTask"/> > >   classname="org.apache.catalina.ant.ListTask"/> > >   classname="org.apache.catalina.ant.ReloadTask"/> > >   classname="org.apache.catalina.ant.ResourcesTask"/> > >      classname="org.apache.catalina.ant.RolesTask"/> > >      classname="org.apache.catalina.ant.StartTask"/> > >   classname="org.apache.catalina.ant.StopTask"/> > >   classname="org.apache.catalina.ant.UndeployTask"/> > > > > > >   > >       description="Compile web application"> > >       > > > >       description="Reload web application" > >           >    depends="compile"> > >         username="${username}" password="${password}" > >               > path="${path}"/> > >       > > > > > >   >           depends="compile"> > >     username="${username}" password="${password}" > >             path="${path}" > war="file:${build}${path}.war"/> > >   > > > >   > >     username="${username}" password="${password}" > >             > path="${path}"/> > >   > > > > > > > > > > When I run "ant reload -debug" I got this error: > > > > > >                 > Adding reference: ant.PropertyHelper > > Detected Java version: 1.6 in: > /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre > > Detected OS: Linux > > Adding reference: ant.ComponentHelper > > Setting ro project property: ant.file -> > /mnt/ikub_nutch/AppHelpers/ManageWebApps/build.xml > > Adding reference: ant.projectHelper > > Adding reference: ant.parsing.context > > Adding reference: ant.targets > > parsing buildfile > /mnt/ikub_nutch/AppHelpers/ManageWebApps/build.xml with > URI = > file:/mnt/ikub_nutch/AppHelpers/ManageWebApps/build.xml > > Setting ro project property: ant.project.name -> > ManageApp > > Adding reference: ManageApp > > Setting ro project property: ant.file.ManageApp -> > /mnt/ikub_nutch/AppHelpers/ManageWebApps/build.xml > > Project base dir set to: > /mnt/ikub_nutch/AppHelpers/ManageWebApps > > +Target: > > +Target: compile > > +Target: reload > > +Target: deploy > > +Target: undeploy > > [antlib:org.apache.tools.ant] Could not load definitions > from resource > org/apache/tools/ant/antlib.xml. It could not be found. > > Setting project property: build -> > /mnt/ikub_nutch/AppHelpers/ManageWebApps/build > > Setting project property: path -> ikub_MainInstance > > Setting project property: url -> http://localhost:8080/manager/html > > Setting project property: username -> manager > > Setting project property: password -> manager123+ > > Class org.apache.catalina.ant.DeployTask loaded from parent > loader > (parentFirst) > > +Datatype deploy org.apache.catalina.ant.DeployTask > > Class org.apache.catalina.ant.ListTask loaded from parent > loader > (parentFirst) > > +Datatype list org.apache.catalina.ant.ListTask > > Class org.apache.catalina.ant.ReloadTask loaded from parent > loader > (parentFirst) > > +Datatype reload org.apache.catalina.ant.ReloadTask > > Class org.apache.catalina.ant.ResourcesTask loaded from > parent loader > (parentFirst) > > Trying to override old definition of datatype resources > > +Datatype resources org.apache.catalina.ant.ResourcesTask > > Class org.apache.catalina.ant.RolesTask loaded from parent > loader > (parentFirst) > > +Datatype roles org.apache.catalina.ant.RolesTask > > Class org.apache.catalina.ant.StartTask loaded from parent > loader > (parentFirst) > > +Datatype start org.apache.catalina.ant.StartTask > > Class org.apache.catalina.ant.StopTask loaded from parent > loader > (parentFirst) > > +Datatype stop org.apache.catalina.ant.StopTask > > Class org.apache.catalina.ant.UndeployTask loaded from > parent loader > (parentFirst) > > +Datatype undeploy org.apache.catalina.ant.UndeployTask > > Attempting to create object of type > org.apache.tools.ant.helper.DefaultExecutor > > Adding reference: ant.executor > > Build sequence for target(s) `reload' is [compile, reload] > > Complete build sequence is [compile, reload, deploy, > undeploy, ] > > > > compile: > > > > reload: > >    [reload] > >    [reload] > >    [reload]