ANT 1.5.1 works fine excapt for my first trials using >classfileset<.
---
THE ERROR MESSAGE:

BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/bcel/classfile/Visitor
---
MY CODE:

    <classfileset id="cfs" dir="C:\rolf\Java\build\WEB-INF\classes">
        <root classname="de.toolsprofi.helloWorld.HelloWorld"/>
    </classfileset>

where HelloWorld refences one other class.
The jar file is build with
    <target name="jar" depends="init,compile">
        <jar compress="true" jarfile="${jar}" manifest="./Manifest.mf">
            <fileset refid="cfs"/>
        </jar>
    </target>

and works fine, if I include a basedir, an include and omitt the fileset
but not the way as shown above.
---
WHAT I DID SO FAR:
I tested the fileset reference by refering to fileset instead of a 
classfileset (including the other class "manually") - worked fine.
I looked thru all the jars that came with 1.5.1 (4:  ant, optional, 
xercesImpl, xml-apis) but could not find the class Visitor.
I reread the deployment advices carefully but could not find any hint 
e.g. to install BCEL prior to ANT.
---
MY QUESTION:
I do not know what's the next step to get classfileset generating a 
distributable complete jar.
So if you know what I've done wrong please give me a hint.

Thanks in advance
Rolf
---
APPENDIX:
the complete error message

C:\rolf\Java\src\de\toolsprofi\helloWorld>ant
Buildfile: build.xml

init:

HelloWorld:

compile:
     [echo] done

jar:

BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/bcel/classfile/Visitor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at 
org.apache.tools.ant.types.optional.depend.DependScanner.scan(DependS
canner.java:163)
        at 
org.apache.tools.ant.types.optional.depend.ClassfileSet.getDirectoryS
canner(ClassfileSet.java:181)
        at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Abstra
ctFileSet.java:360)
        at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:322)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 1 second
java.lang.NoClassDefFoundError: org/apache/bcel/classfile/Visitor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:140)
        at 
org.apache.tools.ant.types.optional.depend.DependScanner.scan(DependS
canner.java:163)
        at 
org.apache.tools.ant.types.optional.depend.ClassfileSet.getDirectoryS
canner(ClassfileSet.java:181)
        at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Abstra
ctFileSet.java:360)
        at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:322)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
org/apache/bcel/classfile/Visitor


---
the complete build xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="helloWorld">
    <target name="init">
        <property name="package" value="de.toolsprofi.helloWorld"/>
        <property name="packagePath" value="de/toolsprofi/helloWorld"/>
        <property file="${user.home}/.ant-global.properties"/>
        <property name="src" value="${basedir}/../../.."/>
        <property name="build" value="${src}/../build/WEB-INF"/>
        <property name="doc" value="${build}/docs"/>
        <property name="classes" value="${build}/classes"/>
        <property name="lib" value="${build}/lib"/>
        <property name="jar" value="${lib}/helloWorld.jar"/>
        <property name="build.sysclasspath" value="last"/>
        <delete quiet="true">
            <fileset dir="${basedir}" includes="**/*.class"/>
        </delete>
    </target>
   
    <!-- classfileset id="cfs" dir="${classes}" -->
    <classfileset id="cfs" dir="C:\rolf\Java\build\WEB-INF\classes">
        <root classname="de.toolsprofi.helloWorld.HelloWorld"/>
        <!-- include name="de/toolsprofi/rsc/Log.class"/ -->
    </classfileset>
   
    <path id="cp">
        <pathelement location="${classes}"/>
        <fileset dir="/" includes="${lib}/**/*.jar"/>
    </path>

    <target name="HelloWorld" depends="init">
        <javac debug="yes" deprecation="yes" includeAntRuntime="no" 
includeJavaRuntime="yes"
            classpathref="cp" destdir="${classes}" srcdir="${src}">
            <include name="${packagePath}/HelloWorld.java"/>
        </javac>
    </target>

    <target name="compile" depends="init,HelloWorld" 
description="compile all  for ${package}">
        <echo message="done"/>
    </target>

    <target name="jar" depends="init,compile" description="jar package 
${package}">
        <!-- jar basedir="${classes}" compress="true" jarfile="${jar}" 
manifest="./Manifest.mf" -->
        <jar compress="true" jarfile="${jar}" manifest="./Manifest.mf">
            <!-- include name="${packagePath}/**/*.class"/ -->
            <fileset refid="cfs"/>
        </jar>
    </target>

    <target name="all" depends="init,jar,doc" description="build 
everything  for ${package}">
        <echo message="rsc built."/>
    </target>

    <target name="doc" depends="init" description="document all for 
${package}">
        <javadoc destdir="${doc}" packagenames="${package}.*" 
sourcepath="${src}">
            <link href="file:///C:/rolf/Java/docs/index.html" />
        </javadoc>
    </target>

    <target name="clean" depends="init" description="Clean ${package}">
        <delete dir="${classes}/${packagePath}" quiet="true"/>
        <delete file="${jar}" quiet="true"/>
        <delete dir="${doc}/${packagePath}" quiet="true"/>
    </target>
   
    <target name="run" depends="init,compile,jar" description ="make and 
start ${package}">
        <java  jar="${jar}" fork="true" classpathref="cp"/>
    </target>

</project>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to