jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: testing ejb by ant
Date Wed, 21 May 2003 08:47:38 GMT
Hi Maria,

[please don't send HTML mails to this list BTW]

I'm not sure what the problem is, but I'm using the <cactifywar> task in 
a couple of places without problems.

I wonder why you explicitly add the CactifyWarTask.class to the 
classpath of the <taskdef>, because that class should of course be in 
the cactus-integration-ant.jar. Also you shouldn't need a batch file at 
all, as the classpath should get correctly setup by Ant. Have you tried 
invoking the script without the Batch file?

If you run with -debug, do you see a root cause or maybe a message about 
a JAR being dropped from the classpath?

It shouldn't be necessary, but can you try adding the following line to 
the <classpath> of the <taskdef>:

   <pathelement path="${java.class.path}"/>

Thanks,
-chris

Maria Sole Franzin wrote:
> Hi all,
> 
> i’m trying another way to test my ejb by the ant integration.
> 
> Well, this is my test_ant.xml file:
> 
> 
> <project name="Cactus" default="" basedir=".">
> <property name="LIB_PATH" 
> value="C:/cactus/NUOVOtestcactus/EJBtestcactus/lib"/>
> <property name="SRC" value="C:/cactus/NUOVOtestcactus/EJBtestcactus/src"/>
> <property name="CLASSES" 
> value="C:/cactus/NUOVOtestcactus/EJBtestcactus/classes"/>
> <property name="BUILD" value="C:/cactus/NUOVOtestcactus/EJBtestcactus"/>
> <property name="PORT" value="8080"/>
> 
> <taskdef resource="cactus.tasks">
>    <classpath>
>       <pathelement location="${LIB_PATH}/cactus-framework.jar"/>
>       <pathelement 
> location="${LIB_PATH}/cactus-integration-ant-20030515.jar"/>
>       <pathelement 
> location="${LIB_PATH}/commons-httpclient-2.0alpha1-20020720.jar"/>
>       <pathelement location="${LIB_PATH}/commons-logging-1.0.jar"/>
>       <pathelement 
> location="${LIB_PATH}/cactus-tasks/org/apache/cactus/integration/ant/CactifyWarTask.class"/>
>    </classpath>
> 
> </taskdef>
> 
> <target name="testConverter">
> 
>    <javac srcdir="${SRC}" destdir="${CLASSES}" debug="on"/>
> 
>    <cactifywar srcfile="${BUILD}/cactuswebapp.war">
> 
>       <servletredirector mapping="/test/servletRedirector"/>
> 
>    </cactifywar>
> 
>    <runservertests 
> testurl="http://localhost:${PORT}/cactuswebapp/ServletTestRunner?suite=testcactus.ConverterTest"/>
> 
> </target>
> 
> </project>
> 
>  
> 
> I don’t know if I used <cactifywar> in the right way, but this is not 
> the matter now, because i get another error running this file: I writed 
> a batch file:
> 
>  
> 
>  
> 
> rem $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
> 
> set PROJECT_HOME=C:\cactus\NUOVOtestcactus\EJBtestcactus
> 
> set 
> ant_integration=C:\cactus\NUOVOtestcactus\EJBtestcactus\lib\cactus-integration-ant-20030515.jar
> 
> set LOG4J_PATH=%PROJECT_HOME%\lib\log4j-1.2.5.jar
> 
> set ANT_HOME=C:\Programmi\apache-ant-1.5.3-1
> 
> set CACTUS_HOME=C:\cactus\jakarta-cactus-13-1.4b1
> 
> set JAVA_HOME=C:\jbuilder5\jdk1.3
> 
> set PATH=%PATH%;%CACTUS_HOME%;%ant_integration%;%cactifywar%;%ANT_HOME%\bin;
> 
> set 
> CLASSPATH=%CLASSPATH%;%PROJECT_HOME%;%CACTUS_HOME%;%LOG4J_PATH%;%ant_integration%;
> 
>  
> 
> ant -verbose -buildfile test_ant.xml %1
> 
> rem $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
> 
>  
> 
>  
> 
>       So runnig test_ant testConverter i got this error on the taskdef 
> cactus.tasks:
> 
> echo off
> 
>  
> 
>  
> 
> C:\cactus\NUOVOtestcactus\EJBtestcactus>echo off
> 
> ECHO disattivato.
> 
> Apache Ant version 1.5.3 compiled on April 16 2003
> 
> Buildfile: test_ant.xml
> 
> Detected Java version: 1.3 in: C:\jbuilder5\jdk1.3\jre
> 
> Detected OS: Windows 2000
> 
> parsing buildfile test_ant.xml with URI = 
> file:C:/cactus/NUOVOtestcactus/EJBtest
> 
> cactus/test_ant.xml
> 
> Project base dir set to: C:\cactus\NUOVOtestcactus\EJBtestcactus
> 
>   [taskdef] Loading definitions from resource cactus.tasks
> 
>  
> 
> BUILD FAILED
> 
> file:C:/cactus/NUOVOtestcactus/EJBtestcactus/test_ant.xml:11: taskdef 
> class org.
> 
> apache.cactus.integration.ant.CactifyWarTask cannot be found
> 
>         at 
> org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:240)
> 
>                 .....
> 
>  
> 
> the cactus.tasks file is in the ant-integration.jar, as cactifywar.class 
> file....
> 
>  
> 
> i’ve no idea how to solve this problem and why it happens.
> 
>  
> 
> Thanks in advance
> 
>  
> 
> Cheers
> 
> Maria Sole
> 


-- 
Christopher Lenz
/=/ cmlenz at gmx.de


Mime
View raw message