ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Pracht <bpra...@nc.rr.com>
Subject Why can't Ant find my class?
Date Mon, 23 Feb 2004 17:20:27 GMT
Hello,

I wrote a class to filter out EOF's and bad newline characters because 
the fixcrlf task neither worked for me nor was convenient.  That said,
in my test cases, it could find the class file in the jar.  Now, when I 
try to use it in a different project, this build code:


         <copy todir="${filtered_source}" overwrite="false" 
verbose="true" flatten="false" includeEmptyDirs="true" >
             <fileset dir="." 
includes="**/*.c,**/*.cpp,**/*.h,**/*.hpp,**/*.java,**/*.txt,**/*.fgl,**/*.shl,**/*.rul,**/*.ipr"
 
excludes="filtered_source/**/*,xks/**/*,build/**/*,install/**/*,internal/**/*,package/**/*,sys/**/*"

casesensitive="false"/>
             <filterset>
                 <filter token="__IBM_SCD_SCR_SERVICE_LEVEL__" 
value="${SCD_SCR_SERVICE_LEVEL}"/>
                 <filter token="__IBM_SCD_SCR_DRIVER_LEVEL__" 
value="${SCD_SCR_DRIVER_LEVEL}"/>
                 <filter token="__IBM_SCD_SCR_VERSION__" 
value="${SCD_SCR_VERSION}"/>
                 <filter token="__IBM_SCD_SCR_VERSION_TYPE__" 
value="${SCD_SCR_VERSION_TYPE}"/>
                 <!-- CF2707
                 <filter token="__IBM_SCD_SCR_COPYRIGHT__" value="(C) 
Copyright IBM Corp. 2003.  All rights reserved."/>
                 -->
                 <!-- CT2707 -->
                 <filter token="__IBM_SCD_SCR_COPYRIGHT__" 
value="${SCD_SCR_COPYRIGHT_STATEMENT}"/>
                 <!-- E2707 -->
                 <filter token="__IBM_SCD_SCR_BASE_DIRECTORY__" 
value="${basedir}"/>
                 <filter token="__IBM_SCD_SCR_BUILD_DATE__" 
value="${buildTimestamp}"/>
                 <filter token="__IBM_SCD_SCR_BUILD_NUMBER__" 
value="${buildNumber}"/>
                 <filter token="__IBM_SCD_SCR_USERS_GUIDE_NAME__" 
value="${SCD_SCR_USERS_GUIDE_NAME}"/>
                 <filter token="__IBM_SCD_SCR_OS_NAME__" 
value="${OSNameTrimmed}"/>
                 <filter token="__IBM_SCD_SCR_OS_VERSION__" 
value="${os.version}"/>
                 <filter token="__IBM_SCD_SCR_OS_ARCHITECTURE__" 
value="${os.arch}"/>
             </filterset>
             <!-- A2589 -->
             <filterchain>
                 <filterreader classname="FixCRLFFilter">
                     <classpath>
                         <pathelement 
path="/mnt/bprachtm2/FixCRLFFilter/current/install/debug/Linux/2.4.18-14/i386/FixCRLFFilter.jar"/>
                     </classpath>
                 </filterreader>
             </filterchain>
             <!-- E2589 -->

         </copy>


results in:

java.lang.NoClassDefFoundError: org/apache/tools/ant/filters/ChainableReader
	at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1085)
	at org.apache.tools.ant.Main.runBuild(Main.java:665)
	at org.apache.tools.ant.Main.startAnt(Main.java:220)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)
Caused by: java.lang.NoClassDefFoundError: 
org/apache/tools/ant/filters/ChainableReader
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
	at 
org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1218)
	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:994)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:207)
	at 
org.apache.tools.ant.filters.util.ChainReaderHelper.getAssembledReader(ChainReaderHelper.java:188)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:582)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:348)
	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:645)
	at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:449)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:272)
	at org.apache.tools.ant.Task.perform(Task.java:401)
	at org.apache.tools.ant.Target.execute(Target.java:347)
	at org.apache.tools.ant.Target.performTasks(Target.java:374)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1228)
	... 5 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: org/apache/tools/ant/filters/ChainableReader
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
	at 
org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1218)
	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:994)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:207)
	at 
org.apache.tools.ant.filters.util.ChainReaderHelper.getAssembledReader(ChainReaderHelper.java:188)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:582)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:348)
	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:645)
	at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:449)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:272)
	at org.apache.tools.ant.Task.perform(Task.java:401)
	at org.apache.tools.ant.Target.execute(Target.java:347)
	at org.apache.tools.ant.Target.performTasks(Target.java:374)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1228)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1085)
	at org.apache.tools.ant.Main.runBuild(Main.java:665)
	at org.apache.tools.ant.Main.startAnt(Main.java:220)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)



Some points:
*  The jar file both exists and has the class file FixCRLFFilter.
*  Notice that I gave Ant an absolute path name to hopefully force him 
to look where he's supposed to.
*  The class FixCRLFFilter implements ChainableReader.

What gives?

Thanks in advance,
Ben Pracht




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message