Problems with ANT - jsfunitwar - ClassNotFoundException
tomt1 Aug 27, 2009 11:29 AMHello,
first of all I have to admit that I don't know much about Ant, therefore please excuse me if it is a dumb question.
I found the following script in this forum (see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=115623). I only adjusted the values of the war-files and some jar-file-versions.
<project name="Test" default="default" basedir="."> <description>Tests the jsfunitwar ant task.</description> <property name="src.war.dir" location="${basedir}/sourcewar"/> <property name="src.war" location="${src.war.dir}/Test.war"/> <property name="dest.war.dir" location="${basedir}/destwar"/> <property name="dest.war" location="${dest.war.dir}/MyTest.war"/> <property name="lib.dir" location="${basedir}/lib"/> <!-- Libraries required for jsfunitwar ant task --> <property name="jsfunit.ant.jar" location="${lib.dir}/jboss-jsfunit-ant-1.1.0.GA.jar"/> <property name="aspectjrt.jar" location="${lib.dir}/aspectjrt-1.2.1.jar"/> <property name="jsfunit.jar" location="${lib.dir}/jboss-jsfunit-core-1.1.0.GA.jar"/> <property name="cactus.jar" location="${lib.dir}/cactus-13-1.7.1.jar"/> <property name="cactus.ant.jar" location="${lib.dir}/cactus-ant-13-1.7.1.jar"/> <property name="httpunit.jar" location="${lib.dir}/httpunit-1.6.jar"/> <property name="junit.jar" location="${lib.dir}/junit-3.8.1.jar"/> <property name="jtidy.jar" location="${lib.dir}/jtidy-4aug2000r7-dev.jar"/> <property name="cargo.jar" location="${lib.dir}/cargo-0.5.jar"/> <path id="jsfunit.classpath"> <pathelement location="${jsfunit.ant.jar}"/> <pathelement location="${aspectjrt.jar}"/> <pathelement location="${cactus.jar}"/> <pathelement location="${cactus.ant.jar}"/> <pathelement location="${jsfunit.jar}"/> <pathelement location="${junit.jar}"/> <pathelement location="${jtidy.jar}"/> <pathelement location="${cargo.jar}"/> <pathelement location="${httpunit.jar}"/> </path> <taskdef name="jsfunitwar" classname="org.jboss.jsfunit.ant.JSFUnitWarTask" classpathref="jsfunit.classpath"/> <target name="default" depends="make.jsfunit.war"> </target> <target name="clean"> <delete dir="${dest.war.dir}"/> <mkdir dir="${dest.war.dir}"/> </target> <target name="make.jsfunit.war" depends="clean"> <jsfunitwar srcfile="${src.war}" destfile="${dest.war}"> <TestRunner/> </jsfunitwar> </target> </project>
When executing this script I get:
java.io.FileNotFoundException: C:\...\jsfunitwartask5564507522452238202\Test.war\META-INF\MANIFEST.MF (The system can't find the specified path)
I created the .war using Eclipse (WTP). I selected my project, clicked on export -> war and thats it. After that I deployed the war and everything was fine - I can access my app.
After getting the error I imported the war and created a new project by the means of this. The new project contains the META-INF and MANIFEST.MF. Is it a problem that eclipse stores this dir in the WebContent dir? Or did I forget something in the ant-script?
Any help is appreciated. Thank you in advance.