2 Replies Latest reply on Sep 8, 2009 4:18 PM by ssilvert

    Problems with ANT - jsfunitwar - ClassNotFoundException

    tomt1

      Hello,
      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.

        • 1. Re: Problems with ANT - jsfunitwar - ClassNotFoundException
          tomt1

          First of all excuse my mistake in the thread topic. Of course its a filenotfoundexception and not a classnotfoundexception.

          I tested the script with another war (one from myfaces-examples) and it worked for this jar. Therefore I think I probably do something wrong exporting my war. Is there anything special to take into account? I'm using Eclipse WTP and created a dynamic web project. Then I simply select my project and click on export -> war. In this dialog i can't input lots of things - I can only enter the name of the exported war. Do I have to adjust other settings in my eclipse or what am I doing wrong?

          Any kind of help is really appreciated.

          • 2. Re: Problems with ANT - jsfunitwar - ClassNotFoundException
            ssilvert

            Sorry Tom. I'm not an Eclipse user, so I'm not familiar with exporting a WAR. Perhaps someone else can comment?

            Stan