From user-return-59210-apmail-ant-user-archive=ant.apache.org@ant.apache.org Tue Jan 02 22:31:45 2007 Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 93746 invoked from network); 2 Jan 2007 22:31:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2007 22:31:44 -0000 Received: (qmail 35864 invoked by uid 500); 2 Jan 2007 22:31:45 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 35732 invoked by uid 500); 2 Jan 2007 22:31:45 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 35721 invoked by uid 99); 2 Jan 2007 22:31:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 14:31:45 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ayoung@vigilos.com designates 216.231.46.252 as permitted sender) Received: from [216.231.46.252] (HELO tonga.vigilos.com) (216.231.46.252) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 14:31:36 -0800 Received: from [192.168.10.181] ([192.168.10.181]) by tonga.vigilos.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 2 Jan 2007 14:31:16 -0800 Message-ID: <459ADD34.2070406@vigilos.com> Date: Tue, 02 Jan 2007 14:31:16 -0800 From: Alasdair Young User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: Ant Users List Subject: Re: "java.lang.ClassNotFoundException" when running junit task References: <459ACB14.4080505@vigilos.com> In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jan 2007 22:31:16.0348 (UTC) FILETIME=[B75EABC0:01C72EBD] X-Virus-Checked: Checked by ClamAV on apache.org "export CLASSPATH=$CLASSPATH:$ANT_HOME/lib/junit.jar" just out of interest, can my junit.jar file be called junit-4.1.jar? Or it MUST be called junit.jar? - alasdair Hussam Al-Tayeb wrote: > On 1/2/07, Alasdair Young wrote: >> Hi! >> >> I'm trying to set up some automated builds for the first time here and >> I'm using a legacy ant build script that I've been hacking away at to >> get junit working. >> >> I am running ant 1.7, Junit 4.1 and java 1.5 on fedora core 5. >> >> When I try to get junit to run my tests via ant, I get the following: >> >> > test: >> > [junit] Testsuite: >> com.vigilos.apps.setup.TestScheduledtlTableModel >> > [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec >> > >> > [junit] Null Test: Caused an ERROR >> > [junit] com.vigilos.apps.setup.TestScheduledtlTableModel >> > [junit] java.lang.ClassNotFoundException: >> > com.vigilos.apps.setup.TestScheduledtlTableModel >> > [junit] at >> java.net.URLClassLoader$1.run(URLClassLoader.java:200) >> > [junit] at java.security.AccessController.doPrivileged(Native >> > Method) >> > [junit] at >> > java.net.URLClassLoader.findClass(URLClassLoader.java:188) >> > [junit] at >> java.lang.ClassLoader.loadClass(ClassLoader.java:306) >> > [junit] at >> java.lang.ClassLoader.loadClass(ClassLoader.java:251) >> > [junit] at >> java.lang.ClassLoader.loadClass(ClassLoader.java:251) >> > [junit] at >> > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >> > [junit] at java.lang.Class.forName0(Native Method) >> > [junit] at java.lang.Class.forName(Class.java:242) >> > >> > >> > >> > BUILD FAILED >> > /home/ayoung/vigilos/subversion/trunk/java/build.xml:42: Test >> > com.vigilos.apps.setup.TestScheduledtlTableModel failed >> >> relevant parts of build.xml: >> >> > >> > >> > >> > >> > > > >> location=".:../java/build:../thirdParty/signedJars/jh.jar:../thirdParty/signedJars/jai_codec.jar:../thirdParty/signedJars/jcchart.jar:../thirdParty/signedJars/jlfgr-1_0.jar:../thirdParty/signedJars/ojdbc14.jar:../thirdParty/signedJars/scrollabledesktop.jar:../thirdParty/signedJars/ftpbean.jar:../thirdParty/signedJars/jai_core.jar:../thirdParty/signedJars/jdbcpool-0.99.jar:../thirdParty/signedJars/log4j-1.2.5.jar:../thirdParty/signedJars/pg73jdbc3.jar:../thirdParty/unsignedJars/jmf.jar:../thirdParty/unsignedJars/commons-collections.jar:../thirdParty/unsignedJars/commons-pool-1.1.jar:../thirdParty/unsignedJars/commons-dbcp-1.1.jar:../thirdParty/signedJars/jcalendar.jar:${tomcat-dir}/common/lib/servlet-api.jar:${tomcat-dir}/common/lib/jsp-api.jar:../thirdParty/unsignedJars/junit-4.1.jar:./build-tests:../javatest:./build-tests/com/vigilos/apps/setup/TestScheduledtlTableModel.class" >> >> > /> >> > >> >> > >> > >> > >> > >> > >> > > > includes="**/*.class" /> >> > >> > >> > >> >> NOTES: >> >> I have junit-4.1.jar in my $ANT_HOME/lib >> >> The project.classpath is a mess - several items at the end were tacked >> on as I tried different things. >> >> I read the FAQ entry >> (http://ant.apache.org/faq.html#delegating-classloader) and several >> blogs that also described the issue - I am not able to make any of these >> resources useful to me. Either they don't apply or my lack of >> understanding is getting in the way. >> >> (Specifically: "Ant doesn't load the external library directly, it is >> the loaded class that does so. In the case of || it is the task >> implementation itself." doesn't make a lot of sense to me.) >> >> So... any ideas? >> >> I tried running ant with -debug turned on and didn't notice anything >> obvious. I think my next step is to take that horrible mess of a >> project.classpath and turn it into a collection of seperate >> tags and then find out if any of these can't be found but >> I would welcome any help that anyone can give me. >> >> Kind regards, >> >> - alasdair >> >> Alasdair Young >> Vigilos Inc. >> >> >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >> For additional commands, e-mail: user-help@ant.apache.org >> >> > I solved this by doing export > CLASSPATH=$CLASSPATH:$ANT_HOME/lib/junit.jar > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org