ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: antlib.xml could not be found
Date Thu, 10 Mar 2011 16:49:06 GMT

you need to declare taskdef (which you have done) but in order for other ant tasks to locate
your Deploy task you will need to
place the entry into antlib.xml (located on classpath) e.g.
<antlib>
  <typedef name="Deploy"
    classname="org.apache.catalina.ant.DeployTask" />
..............other entries................
</antlib>

Nota Bene: Steve Loughrans book 'Ant in anger' is a must buy for ant newbies

HTH
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni
et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.




> From: marseld.dedgjonaj@ikubinfo.com
> To: user@ant.apache.org
> Subject: antlib.xml could not be found
> Date: Thu, 10 Mar 2011 16:39:41 +0100
> 
> 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>
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message