Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 11649 invoked from network); 17 Oct 2002 00:04:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 17 Oct 2002 00:04:10 -0000 Received: (qmail 29956 invoked by uid 97); 17 Oct 2002 00:04:55 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 29938 invoked by uid 97); 17 Oct 2002 00:04:55 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 29914 invoked by uid 98); 17 Oct 2002 00:04:54 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Sent: 17 Oct 2002 00:04:03 GMT Message-ID: <3DADFE7C.9070309@ehatchersolutions.com> Date: Wed, 16 Oct 2002 20:04:12 -0400 From: Erik Hatcher User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: Problem with using jar files for user defined taskdefs References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Mark Arnold wrote: > When I try to execute my task, ant is giving me a ClassNotFoundException saying that com.mine.myOwnSpecialTask does not exist. > The jar file is fine however. > > Copying mySpecial.jar into %ANT_HOME%/lib did not help either. After some hours I finally found that copying all the 3 jar files > (optional.jar was already there anyway, but junit.jar was not there yet) into %ANT_HOME%/lib as well finally made it work. > > So 2 questions: > 1. Why do I have to copy the jars into %ANT_HOME%/lib if I already specify them in the classpath tag for the taskdef? Does your task have any other external dependencies besides those three JAR files? If so, you need to specify those in the as well. > 2. Why does ant tell me it can not find myOwnSpecialTask in mySpecial.jar if the problem is really the junit.jar and some of the > classes in there which I inherit myOwnSpecialTask from? If it can't load your task (possibly because of a missing dependency) then you can see this error. > Is this problem a bug in ant or is the classpath tag within the taskdef not meant to be used for what I think it is? Its just the nature of the classloader beast, I believe. Erik -- To unsubscribe, e-mail: For additional commands, e-mail: