ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vimil Saju <vimils...@yahoo.com>
Subject Re: antlib.xml could not be found
Date Thu, 10 Mar 2011 16:41:39 GMT

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 <marseld.dedgjonaj@ikubinfo.com> wrote:

> From: Marseld Dedgjonaj <marseld.dedgjonaj@ikubinfo.com>
> 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:
> 
>  
> 
> <project name="ManageApp" default="compile"
> basedir=".">
> 
>  
> 
>   <!-- Configure the directory into which the web
> application is built -->
> 
>   <property name="build"   
> value="${basedir}/build"/>
> 
>  
> 
>   <!-- Configure the context path for this
> application -->
> 
>   <property name="path" 
>    value="ikub_MainInstance"/>
> 
>  
> 
>   <!-- Configure properties to access the Manager
> application -->
> 
>   <property name="url"     
> value="http://localhost:8080/manager/html"/>
> 
>   <property name="username" value="manager"/>
> 
>   <property name="password"
> value="manager123+"/>
> 
>  
> 
>   <!-- Configure the custom Ant tasks for the
> Manager application -->
> 
>   <taskdef name="deploy"   
> classname="org.apache.catalina.ant.DeployTask"/>
> 
>   <taskdef name="list"     
> classname="org.apache.catalina.ant.ListTask"/>
> 
>   <taskdef name="reload"   
> classname="org.apache.catalina.ant.ReloadTask"/>
> 
>   <taskdef name="resources"
> classname="org.apache.catalina.ant.ResourcesTask"/>
> 
>   <taskdef name="roles" 
>    classname="org.apache.catalina.ant.RolesTask"/>
> 
>   <taskdef name="start" 
>    classname="org.apache.catalina.ant.StartTask"/>
> 
>   <taskdef name="stop"     
> classname="org.apache.catalina.ant.StopTask"/>
> 
>   <taskdef name="undeploy"
> classname="org.apache.catalina.ant.UndeployTask"/>
> 
>  
> 
>  
> 
>   <!-- Executable Targets -->
> 
>      <target name="compile"
> description="Compile web application">
> 
>      </target>
> 
>  
> 
>      <target name="reload"
> description="Reload web application"
> 
>          
>    depends="compile">
> 
>        <reload url="${url}"
> username="${username}" password="${password}"
> 
>              
> path="${path}"/>
> 
>      </target>
> 
>  
> 
>  
> 
>   <target name="deploy" description="Install web
> application"
> 
>           depends="compile">
> 
>     <deploy url="${url}"
> username="${username}" password="${password}"
> 
>             path="${path}"
> war="file:${build}${path}.war"/>
> 
>   </target>
> 
>  
> 
>   <target name="undeploy" description="Remove web
> application">
> 
>     <undeploy url="${url}"
> username="${username}" password="${password}"
> 
>            
> path="${path}"/>
> 
>   </target>
> 
>  
> 
> </project>
> 
>  
> 
>  
> 
> 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] <html>
> 
>    [reload] <head>
> 
>    [reload] <style>
> 
>  
> 
> ....
> 
>  
> 
>   [reload] </html>
> 
>  
> 
> BUILD FAILED
> 
> <html>
> 
>                 at
> org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
> va:258)
> 
>                 at
> org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
> va:146)
> 
>                 at
> org.apache.catalina.ant.ReloadTask.execute(ReloadTask.java:72)
> 
>                 at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> 
>                 at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> 
>                 at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
> 
>                 at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
> 
>                 at
> java.lang.reflect.Method.invoke(Method.java:597)
> 
>                 at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> 
>                 at
> org.apache.tools.ant.Task.perform(Task.java:348)
> 
>                 at
> org.apache.tools.ant.Target.execute(Target.java:357)
> 
>                 at
> org.apache.tools.ant.Target.performTasks(Target.java:385)
> 
>                 at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
> 
>                 at
> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
> 
>                 at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.j
> ava:41)
> 
>                 at
> org.apache.tools.ant.Project.executeTargets(Project.java:1189)
> 
>                 at
> org.apache.tools.ant.Main.runBuild(Main.java:758)
> 
>                 at
> org.apache.tools.ant.Main.startAnt(Main.java:217)
> 
>                 at
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
> 
>                 at
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> 
>  
> 
> Total time: 0 seconds
> 
>  
> 
>  
> 
> Please any help for this issue.
> 
>  
> 
> Thanks in advance.
> 
> Best Regards,
> 
> Marseldi
> 
>  
> 
> 
> 
> <p class="MsoNormal"><span style="color: rgb(31,
> 73, 125);">Gjeni <b>Pun&euml; t&euml;
> Mir&euml;</b> dhe <b>t&euml;
> Mir&euml; p&euml;r Pun&euml;</b>...
> Vizitoni: <a target="_blank" href="http://www.punaime.al/">www.punaime.al</a></span></p>
> <p><a target="_blank" href="http://www.punaime.al/"><span
> style="text-decoration: none;"><img width="165"
> height="31" border="0" alt="punaime" src="http://www.ikub.al/images/punaime.al_small.png"
> /></span></a></p>
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message