Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 23597 invoked from network); 10 Dec 2001 02:31:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Dec 2001 02:31:10 -0000 Received: (qmail 9706 invoked by uid 97); 10 Dec 2001 02:31:12 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 9670 invoked by uid 97); 10 Dec 2001 02:31:11 -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 9659 invoked from network); 10 Dec 2001 02:31:09 -0000 From: "William Ferguson" To: "'Ant Users List'" Subject: RE: Setting classpath for Taskdef Date: Mon, 10 Dec 2001 13:29:11 +1100 Message-ID: <002801c18122$74a90670$2e24cfc0@xedoc.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 In-Reply-To: <007f01c1811d$9e32f960$77a7e40f@nordwand> Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N OK. If I remove optional.jar from %ANT_HOME%\lib but define it in the MimeMail taskdef along with J2ee.jar, then Ant can't find the MimeMail task. ie Gives D:\source\main\buildScripts\NightlyBuild.xml:44: taskdef class org.apache.tools.ant.taskdefs.optional.net.MimeMail cannot be found at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:176) at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:114) etc But if I define the taskdef for MimeMail as above and don't remove optional.jar from %ANT_HOME%\lib then I get D:\source\main\buildScripts\NightlyBuild.xml:172: Could not create task of type: mimeMail due to java.lang.NoClassDefFoundError: javax/mail/Address at org.apache.tools.ant.Project.createTask(Project.java:509) at org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:83) at org.apache.tools.ant.Task.perform(Task.java:216) So it wuld seem that Ant definitely requires the optional.jar in its classpath when executed, and can't pick it up from the taskdef classpath attribute. It also seems that Ant requires that any libraries that are needed by an optional task to also be included in Ant's classpath. Ie these classes can't be specified via the classpath attribute of taskdef. So either I'm doing something totally wrong, or the classpath attribute doesn't appear to function. William > -----Original Message----- > From: Steve Loughran [mailto:steve_l@iseran.com] > Sent: Monday, 10 December 2001 12:55 > To: Ant Users List > Subject: Re: Setting classpath for Taskdef > > > > ----- Original Message ----- > From: "William Ferguson" > To: "'Ant Users List'" > Sent: Sunday, December 09, 2001 4:32 PM > Subject: RE: Setting classpath for Taskdef > > > > Thanks Eric, > > > > optional.jar is already in %ANT_HOME%\lib and it finds it OK. > > It's just not finding j2ee.jar > > That is because the task in optional.jar is in a different > classloader from > the j2ee jar. > > > If I explicitly add j2ee.jar to the classpath when I invoke Ant then > > everything works OK. > > But that is not an optimal solution. > > It is all you get unless you pull optional.jar from ant\lib > and include it > in the classpath you spec for MimeMail. > > > -- > To unsubscribe, e-mail: > > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: