Re: anthill, jboss, ant and classpath

Varban <[email protected]> Wed, 11 Jul 2007 09:42:38 -0400
Newsgroups gmane.comp.java.anthill
Message-ID <[email protected]>
Hi Leoš,

from what I can tell your javac ant task fails because of the missing 
jar. The thing is that adding the jar to the anthill.ant.home location 
will not work because that location is for jars required by the ant 
tasks themselves.
My guess is that your ant script javac task needs a "classpath" 
attribute that will point to the location of the ejb3-persistence.jar 
relative to the ant execution directory (this will in reality accomplish 
the same as the "-classpath 
/opt/anthill/lib/apache-ant-1.7.0/ejb3-persistence.jar" option that you 
use from command line).
Here is a link to the ant tutorial that has some examples of javac tasks 
with a classpath attribute: 
http://ant.apache.org/manual/CoreTasks/javac.html

Regards,
Varban

Leoš Urban wrote:
> Hello,
>
> I have some problem and I don't know what is wrong.
> I cannot add jar files to classpath of ANT.
>
> <FAQ>
> To add your own jar files to the classpath when executing Ant, copy
> those jar files into the location pointed to by the "anthill.ant.home"
> property.
> </FAQ>
>
> My ant.home for anthill:
> $ cat /opt/anthill/projects/anthill.registry | grep ant.home
> anthill.ant.home = lib/apache-ant-1.7.0
>
> I have required JAR files in ANT directory: 
> $ ls /opt/anthill/lib/apache-ant-1.7.0/*.jar
> /opt/anthill/lib/apache-ant-1.7.0/ejb3-persistence.jar
> /opt/anthill/lib/apache-ant-1.7.0/jboss-ejb3x.jar
>
> All files are readable by everyone, for our example is required
> ejb3-persistence.jar only.
>
>
> When I compile my file manually then it works -> file is correct:
> $javac -classpath /opt/anthill/lib/apache-ant-1.7.0/ejb3-persistence.jar
> Dluznik.java
>
> But anthill fails:
> -do-compile:
>     [javac] Compiling 1 source file
> to /opt/anthill/work/Dluznici/Dluznici-ejb/build/ear-module
> [javac] /opt/anthill/work/Dluznici/Dluznici-ejb/src/java/cz/qds/dluznici/ebs/Dluznik.java:14: package javax.persistence does not exist
> ...
>
> Project has two additional parameters:
> $cat /opt/anthill/projects/Dluznici.anthill | grep anthill.build
> anthill.build.script = build.xml
> anthill.build.tag = success
> anthill.build.ant.params$1.value = -Dplatforms.JDK6.compiler=modern
> anthill.build.ant.params$2.value =
> -Dplatforms.JDK6.home=/usr/java/jdk1.6.0_01
>
>
> One note - anthill runs under jboss, the same copy of library is in
> jboss classpath - server/all/lib.
>
> I am using JDK6, jboss 4.2.0.GA and Anthill 1.8.1.303.
>
> There must be some problem with classpath because application without
> additional jars are compiled by anthill without problem.
>
> Thank you very much.
>
> Leos
>
>
>
>
>
> _______________________________________________
> Anthill mailing list
> Anthill-IWHQxnLZ/[email protected]
> http://lists.urbancode.com/mailman/listinfo/anthill
>
>