You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by William Ferguson <wi...@versata.com> on 2001/12/10 00:33:08 UTC

Setting classpath for Taskdef

Has anyone managed to set the classpath attribute for TaskDef?

Eg I wanted to get the MimeMail task to work without having to put j2ee.jar
into %ANT_HOME%\lib
or specify it on the command line when invoking Ant. The doco for Taskdef
(and some posts on
this list) seemed to suggest that the following was correct usage.

	<taskdef name="mimeMail"
classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"
		<classpath>
			<pathelement location="${project}/lib/j2ee/j2ee.jar"/>
		</classpath>
	</taskdef>

where ${project}/lib/j2ee/j2ee.jar is where the j2ee.jar resides.
But I just get "Could not create task of type: mimeMail due to
java.lang.NoClassDefFoundError: javax/mail/Address"

Any suggestions?



William Ferguson
Technical Lead - Workflow Functionality
Versata, Inc.
"Business Logic Development and Management"
Ph     +61 03 9428 0788
Fax    +61 03 9428 0786
Email  william_ferguson@versata.com
www.versata.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 10 Dec 2001, William Ferguson <wi...@versata.com>
wrote:

> optional.jar is already in %ANT_HOME%\lib and it finds it OK.

And that's the problem.

You load the task implementation from the system classpath - and the
system classloader doesn't know about j2ee.jar.  This is Java's model
of delegating classloaders (Ant will always consult the system
classloader first).

The only fix:  (1) remove the task implementation from the system
classpath (remove optional.jar from ANT_HOME/lib or remove the classes
in question from that jar) and (2) add the task implementation to your
nested classpath element of the taskdef.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Jill Stephenson <ji...@suncorpmetway.com.au>.
1) I have a mimimal batch script ...

setlocal

rem NULL out the classpath, we set this internally
set CLASSPATH=

rem Java Development Kit
set JAVA_HOME=c:\java\jdk1.3.1_01
set PATH=%JAVA_HOME%\bin;%PATH%

rem ANT
set ANT_HOME=c:\java\jakarta-ant-1.4
set PATH=%PATH%;%ANT_HOME%\bin

cmd /c ant atest

endlocal

2) I moved the optional jar out of ants lib directory

3) I have the following target in my build script

  <target name="atest">
    <taskdef name="mimeMail"

classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
      <classpath>
        <pathelement location="c:/bea/wlserver6.0/lib/weblogic.jar" />
        <pathelement location="c:/java/jakarta-ant-1.4-optional.jar" />
      </classpath>
    </taskdef>

    <mimeMail message="hello world"
              tolist="blah"
              subject="hello"
              from="blah" />

  </target>


While this obviously does not succeed in sending mail the mimeMail task is
actually invoked as you can see in the output below ...

Buildfile: build.xml

atest:
 [mimeMail] sending email

BUILD FAILED

J:\js\working\xxx\build.xml:613: javax.mail.SendFailedException: Sending
failed;
  nested exception is:
        javax.mail.MessagingException: Could not connect to SMTP host:
localhost, port: 25;
  nested exception is:
        java.net.ConnectException: Connection refused: connect

Total time: 2 seconds

--
Jill

----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Monday, December 10, 2001 2:56 PM
Subject: RE: Setting classpath for Taskdef


> > Is ${project} defined and pointing to the right place?
>
> Yes
>
> > Is ${project}/tools/ant/lib/optional.jar" the correct location
> > for where you moved the jar to?
>
> Yes
>
> > Try running your build with -verbose and -debug to see if
> > you can get any more information from that.
>
> Always do - no ehlp there.
>
> How are you invoking Ant?
> Are you using Ant.bat or invoking org.apache.tools.ant.Main directly?
> Do you have optional.jar and j2ee.jar in %ANT_HOME%\lib or have you
> specified them on the Ant command line.
>
> William
>
> >
> > --
> > Jill
> >
> >
> > ----- Original Message -----
> > From: "William Ferguson" <wi...@versata.com>
> > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > Sent: Monday, December 10, 2001 2:27 PM
> > Subject: RE: Setting classpath for Taskdef
> >
> >
> > > The task and the taskdef both have the exact same case 'mimeMail'.
> > >
> > > > -----Original Message-----
> > > > From: Jill Stephenson
> > [mailto:jill.stephenson@suncorpmetway.com.au]
> > > > Sent: Monday, 10 December 2001 14:52
> > > > To: Ant Users List
> > > > Subject: Re: Setting classpath for Taskdef
> > > >
> > > >
> > > > Try changing the name of the taskdef to be all lowercase, it
> > > > seems like the case of the task definition and actual usage of
> > > > the task must match  ...
> > > >
> > > > --
> > > > Jill
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "William Ferguson" <wi...@versata.com>
> > > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > > Sent: Monday, December 10, 2001 12:29 PM
> > > > Subject: RE: Setting classpath for Taskdef
> > > >
> > > >
> > > > > 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
> > > > >
> > > > > <taskdef name="mimeMail"
> > > > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
> > > > > <classpath>
> > > > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > > > > <pathelement location="${project}/tools/ant/lib/optional.jar"/>
> > > > > </classpath>
> > > > > </taskdef>
> > > > >
> > > > > 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(UnknownElem
> > > > ent.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" <wi...@versata.com>
> > > > > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > > > > 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:
> > > > > > <ma...@jakarta.apache.org>
> > > > > > For additional commands, e-mail:
> > > > > > <ma...@jakarta.apache.org>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > >
> > > >
> > > >
> > > > --------------------------------------------------------------
> > > > ---------------------
> > > >
> > > > The contents of this message are the views of the Author and
> > > > do not necessarily reflect the views of SUNCORP METWAY LTD
> > > > ABN 66 010 831 722.
> > > >
> > > > The content of this e-mail, including attachments is a
> > > > confidential communication between the Suncorp Metway Group
> > > > and the intended addressee. Any unauthorised use of the
> > > > contents is expressly prohibited. If you have received this
> > > > e-mail in error please contact the sender immediately and
> > > > then delete the message and any attachment(s).
> > > >
> > > > http://www.suncorpmetway.com.au
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Setting classpath for Taskdef

Posted by William Ferguson <wi...@versata.com>.
> Is ${project} defined and pointing to the right place?

Yes

> Is ${project}/tools/ant/lib/optional.jar" the correct location
> for where you moved the jar to?

Yes

> Try running your build with -verbose and -debug to see if
> you can get any more information from that.

Always do - no ehlp there.

How are you invoking Ant?
Are you using Ant.bat or invoking org.apache.tools.ant.Main directly?
Do you have optional.jar and j2ee.jar in %ANT_HOME%\lib or have you
specified them on the Ant command line.

William

>
> --
> Jill
>
>
> ----- Original Message -----
> From: "William Ferguson" <wi...@versata.com>
> To: "'Ant Users List'" <an...@jakarta.apache.org>
> Sent: Monday, December 10, 2001 2:27 PM
> Subject: RE: Setting classpath for Taskdef
>
>
> > The task and the taskdef both have the exact same case 'mimeMail'.
> >
> > > -----Original Message-----
> > > From: Jill Stephenson
> [mailto:jill.stephenson@suncorpmetway.com.au]
> > > Sent: Monday, 10 December 2001 14:52
> > > To: Ant Users List
> > > Subject: Re: Setting classpath for Taskdef
> > >
> > >
> > > Try changing the name of the taskdef to be all lowercase, it
> > > seems like the case of the task definition and actual usage of
> > > the task must match  ...
> > >
> > > --
> > > Jill
> > >
> > >
> > > ----- Original Message -----
> > > From: "William Ferguson" <wi...@versata.com>
> > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > Sent: Monday, December 10, 2001 12:29 PM
> > > Subject: RE: Setting classpath for Taskdef
> > >
> > >
> > > > 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
> > > >
> > > > <taskdef name="mimeMail"
> > > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
> > > > <classpath>
> > > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > > > <pathelement location="${project}/tools/ant/lib/optional.jar"/>
> > > > </classpath>
> > > > </taskdef>
> > > >
> > > > 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(UnknownElem
> > > ent.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" <wi...@versata.com>
> > > > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > > > 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:
> > > > > <ma...@jakarta.apache.org>
> > > > > For additional commands, e-mail:
> > > > > <ma...@jakarta.apache.org>
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > > >
> > >
> > >
> > > --------------------------------------------------------------
> > > ---------------------
> > >
> > > The contents of this message are the views of the Author and
> > > do not necessarily reflect the views of SUNCORP METWAY LTD
> > > ABN 66 010 831 722.
> > >
> > > The content of this e-mail, including attachments is a
> > > confidential communication between the Suncorp Metway Group
> > > and the intended addressee. Any unauthorised use of the
> > > contents is expressly prohibited. If you have received this
> > > e-mail in error please contact the sender immediately and
> > > then delete the message and any attachment(s).
> > >
> > > http://www.suncorpmetway.com.au
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Jill Stephenson <ji...@suncorpmetway.com.au>.
I got it to work with Ant 1.4 with JDK 1.3.1 on Win2k.

Is ${project} defined and pointing to the right place?

Is ${project}/tools/ant/lib/optional.jar" the correct location
for where you moved the jar to?

Try running your build with -verbose and -debug to see if
you can get any more information from that.

--
Jill


----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Monday, December 10, 2001 2:27 PM
Subject: RE: Setting classpath for Taskdef


> The task and the taskdef both have the exact same case 'mimeMail'.
>
> > -----Original Message-----
> > From: Jill Stephenson [mailto:jill.stephenson@suncorpmetway.com.au]
> > Sent: Monday, 10 December 2001 14:52
> > To: Ant Users List
> > Subject: Re: Setting classpath for Taskdef
> >
> >
> > Try changing the name of the taskdef to be all lowercase, it
> > seems like the case of the task definition and actual usage of
> > the task must match  ...
> >
> > --
> > Jill
> >
> >
> > ----- Original Message -----
> > From: "William Ferguson" <wi...@versata.com>
> > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > Sent: Monday, December 10, 2001 12:29 PM
> > Subject: RE: Setting classpath for Taskdef
> >
> >
> > > 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
> > >
> > > <taskdef name="mimeMail"
> > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
> > > <classpath>
> > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > > <pathelement location="${project}/tools/ant/lib/optional.jar"/>
> > > </classpath>
> > > </taskdef>
> > >
> > > 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(UnknownElem
> > ent.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" <wi...@versata.com>
> > > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > > 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:
> > > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --------------------------------------------------------------
> > ---------------------
> >
> > The contents of this message are the views of the Author and
> > do not necessarily reflect the views of SUNCORP METWAY LTD
> > ABN 66 010 831 722.
> >
> > The content of this e-mail, including attachments is a
> > confidential communication between the Suncorp Metway Group
> > and the intended addressee. Any unauthorised use of the
> > contents is expressly prohibited. If you have received this
> > e-mail in error please contact the sender immediately and
> > then delete the message and any attachment(s).
> >
> > http://www.suncorpmetway.com.au
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Setting classpath for Taskdef

Posted by William Ferguson <wi...@versata.com>.
The task and the taskdef both have the exact same case 'mimeMail'.

> -----Original Message-----
> From: Jill Stephenson [mailto:jill.stephenson@suncorpmetway.com.au]
> Sent: Monday, 10 December 2001 14:52
> To: Ant Users List
> Subject: Re: Setting classpath for Taskdef
> 
> 
> Try changing the name of the taskdef to be all lowercase, it
> seems like the case of the task definition and actual usage of
> the task must match  ...
> 
> --
> Jill
> 
> 
> ----- Original Message -----
> From: "William Ferguson" <wi...@versata.com>
> To: "'Ant Users List'" <an...@jakarta.apache.org>
> Sent: Monday, December 10, 2001 12:29 PM
> Subject: RE: Setting classpath for Taskdef
> 
> 
> > 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
> >
> > <taskdef name="mimeMail"
> > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
> > <classpath>
> > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > <pathelement location="${project}/tools/ant/lib/optional.jar"/>
> > </classpath>
> > </taskdef>
> >
> > 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(UnknownElem
> ent.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" <wi...@versata.com>
> > > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > > 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:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> >
> 
> 
> --------------------------------------------------------------
> ---------------------
> 
> The contents of this message are the views of the Author and 
> do not necessarily reflect the views of SUNCORP METWAY LTD  
> ABN 66 010 831 722. 
> 
> The content of this e-mail, including attachments is a 
> confidential communication between the Suncorp Metway Group 
> and the intended addressee. Any unauthorised use of the 
> contents is expressly prohibited. If you have received this 
> e-mail in error please contact the sender immediately and 
> then delete the message and any attachment(s).
> 
> http://www.suncorpmetway.com.au
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Jill Stephenson <ji...@suncorpmetway.com.au>.
Try changing the name of the taskdef to be all lowercase, it
seems like the case of the task definition and actual usage of
the task must match  ...

--
Jill


----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Monday, December 10, 2001 12:29 PM
Subject: RE: Setting classpath for Taskdef


> 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
>
> <taskdef name="mimeMail"
> classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
> <classpath>
> <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> <pathelement location="${project}/tools/ant/lib/optional.jar"/>
> </classpath>
> </taskdef>
>
> 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" <wi...@versata.com>
> > To: "'Ant Users List'" <an...@jakarta.apache.org>
> > 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:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


-----------------------------------------------------------------------------------

The contents of this message are the views of the Author and do not necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722. 

The content of this e-mail, including attachments is a confidential communication between the Suncorp Metway Group and the intended addressee. Any unauthorised use of the contents is expressly prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s).

http://www.suncorpmetway.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Setting classpath for Taskdef

Posted by William Ferguson <wi...@versata.com>.
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

	<taskdef name="mimeMail"
classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail">
		<classpath>
			<pathelement location="${project}/lib/j2ee/j2ee.jar"/>
			<pathelement location="${project}/tools/ant/lib/optional.jar"/>
		</classpath>
	</taskdef>

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" <wi...@versata.com>
> To: "'Ant Users List'" <an...@jakarta.apache.org>
> 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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Setting classpath for Taskdef

Posted by William Ferguson <wi...@versata.com>.
But that is what I thought was being done by specifying it in the classpath
attribute of TaskDef.
Is this not so?
If not, what does the classpath attribute actually do?

William

> -----Original Message-----
> From: Jill Stephenson [mailto:jill.stephenson@suncorpmetway.com.au]
> Sent: Monday, 10 December 2001 12:29
> To: Ant Users List
> Subject: Re: Setting classpath for Taskdef
>
>
> As per the optional task doco for MimeMail "JavaMail and
> Java Activation Framework are required for this task."  So
> if you don't want to put j2ee.jar in your classpath you must
> at least download the apis and put them in your classpath.
>
> --
> Jill
>
> ----- Original Message -----
> From: "William Ferguson" <wi...@versata.com>
> To: "'Ant Users List'" <an...@jakarta.apache.org>
> Sent: Monday, December 10, 2001 10:32 AM
> 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
> >
> > If I explicitly add j2ee.jar to the classpath when I invoke Ant then
> > everything works OK.
> > But that is not an optimal solution.
> >
> >
> > William
> >
> >
> > > -----Original Message-----
> > > From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> > > Sent: Monday, 10 December 2001 10:48
> > > To: Ant Users List
> > > Subject: Re: Setting classpath for Taskdef
> > >
> > >
> > > At the very least you'll also need Ant's optional.jar in
> that nested
> > > classpath, as that is where
> > > org.apache.tools.ant.taskdefs.optional.net.MimeMail lives.
> > >
> > > I'm not sure that will complete fix it as I haven't tried it
> > > myself, but
> > > that should get it a bit closer.
> > >
> > >     Erik
> > >
> > >
> > > ----- Original Message -----
> > > From: "William Ferguson" <wi...@versata.com>
> > > To: "Ant User (E-mail)" <an...@jakarta.apache.org>
> > > Sent: Sunday, December 09, 2001 6:33 PM
> > > Subject: Setting classpath for Taskdef
> > >
> > >
> > > > Has anyone managed to set the classpath attribute for TaskDef?
> > > >
> > > > Eg I wanted to get the MimeMail task to work without
> having to put
> > > j2ee.jar
> > > > into %ANT_HOME%\lib
> > > > or specify it on the command line when invoking Ant. The
> > > doco for Taskdef
> > > > (and some posts on
> > > > this list) seemed to suggest that the following was
> correct usage.
> > > >
> > > > <taskdef name="mimeMail"
> > > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"
> > > > <classpath>
> > > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > > > </classpath>
> > > > </taskdef>
> > > >
> > > > where ${project}/lib/j2ee/j2ee.jar is where the
> j2ee.jar resides.
> > > > But I just get "Could not create task of type: mimeMail due to
> > > > java.lang.NoClassDefFoundError: javax/mail/Address"
> > > >
> > > > Any suggestions?
> > > >
> > > >
> > > >
> > > > William Ferguson
> > > > Technical Lead - Workflow Functionality
> > > > Versata, Inc.
> > > > "Business Logic Development and Management"
> > > > Ph     +61 03 9428 0788
> > > > Fax    +61 03 9428 0786
> > > > Email  william_ferguson@versata.com
> > > > www.versata.com
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


----------------------------------------------------------------------------
-------

The contents of this message are the views of the Author and do not
necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722.

The content of this e-mail, including attachments is a confidential
communication between the Suncorp Metway Group and the intended addressee.
Any unauthorised use of the contents is expressly prohibited. If you have
received this e-mail in error please contact the sender immediately and then
delete the message and any attachment(s).

http://www.suncorpmetway.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Jill Stephenson <ji...@suncorpmetway.com.au>.
As per the optional task doco for MimeMail "JavaMail and
Java Activation Framework are required for this task."  So
if you don't want to put j2ee.jar in your classpath you must
at least download the apis and put them in your classpath.

--
Jill

----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Monday, December 10, 2001 10:32 AM
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
>
> If I explicitly add j2ee.jar to the classpath when I invoke Ant then
> everything works OK.
> But that is not an optimal solution.
>
>
> William
>
>
> > -----Original Message-----
> > From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> > Sent: Monday, 10 December 2001 10:48
> > To: Ant Users List
> > Subject: Re: Setting classpath for Taskdef
> >
> >
> > At the very least you'll also need Ant's optional.jar in that nested
> > classpath, as that is where
> > org.apache.tools.ant.taskdefs.optional.net.MimeMail lives.
> >
> > I'm not sure that will complete fix it as I haven't tried it
> > myself, but
> > that should get it a bit closer.
> >
> >     Erik
> >
> >
> > ----- Original Message -----
> > From: "William Ferguson" <wi...@versata.com>
> > To: "Ant User (E-mail)" <an...@jakarta.apache.org>
> > Sent: Sunday, December 09, 2001 6:33 PM
> > Subject: Setting classpath for Taskdef
> >
> >
> > > Has anyone managed to set the classpath attribute for TaskDef?
> > >
> > > Eg I wanted to get the MimeMail task to work without having to put
> > j2ee.jar
> > > into %ANT_HOME%\lib
> > > or specify it on the command line when invoking Ant. The
> > doco for Taskdef
> > > (and some posts on
> > > this list) seemed to suggest that the following was correct usage.
> > >
> > > <taskdef name="mimeMail"
> > > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"
> > > <classpath>
> > > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > > </classpath>
> > > </taskdef>
> > >
> > > where ${project}/lib/j2ee/j2ee.jar is where the j2ee.jar resides.
> > > But I just get "Could not create task of type: mimeMail due to
> > > java.lang.NoClassDefFoundError: javax/mail/Address"
> > >
> > > Any suggestions?
> > >
> > >
> > >
> > > William Ferguson
> > > Technical Lead - Workflow Functionality
> > > Versata, Inc.
> > > "Business Logic Development and Management"
> > > Ph     +61 03 9428 0788
> > > Fax    +61 03 9428 0786
> > > Email  william_ferguson@versata.com
> > > www.versata.com
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


-----------------------------------------------------------------------------------

The contents of this message are the views of the Author and do not necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722. 

The content of this e-mail, including attachments is a confidential communication between the Suncorp Metway Group and the intended addressee. Any unauthorised use of the contents is expressly prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s).

http://www.suncorpmetway.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Setting classpath for Taskdef

Posted by William Ferguson <wi...@versata.com>.
Thanks Eric,

optional.jar is already in %ANT_HOME%\lib and it finds it OK.
It's just not finding 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.


William


> -----Original Message-----
> From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> Sent: Monday, 10 December 2001 10:48
> To: Ant Users List
> Subject: Re: Setting classpath for Taskdef
>
>
> At the very least you'll also need Ant's optional.jar in that nested
> classpath, as that is where
> org.apache.tools.ant.taskdefs.optional.net.MimeMail lives.
>
> I'm not sure that will complete fix it as I haven't tried it
> myself, but
> that should get it a bit closer.
>
>     Erik
>
>
> ----- Original Message -----
> From: "William Ferguson" <wi...@versata.com>
> To: "Ant User (E-mail)" <an...@jakarta.apache.org>
> Sent: Sunday, December 09, 2001 6:33 PM
> Subject: Setting classpath for Taskdef
>
>
> > Has anyone managed to set the classpath attribute for TaskDef?
> >
> > Eg I wanted to get the MimeMail task to work without having to put
> j2ee.jar
> > into %ANT_HOME%\lib
> > or specify it on the command line when invoking Ant. The
> doco for Taskdef
> > (and some posts on
> > this list) seemed to suggest that the following was correct usage.
> >
> > <taskdef name="mimeMail"
> > classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"
> > <classpath>
> > <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> > </classpath>
> > </taskdef>
> >
> > where ${project}/lib/j2ee/j2ee.jar is where the j2ee.jar resides.
> > But I just get "Could not create task of type: mimeMail due to
> > java.lang.NoClassDefFoundError: javax/mail/Address"
> >
> > Any suggestions?
> >
> >
> >
> > William Ferguson
> > Technical Lead - Workflow Functionality
> > Versata, Inc.
> > "Business Logic Development and Management"
> > Ph     +61 03 9428 0788
> > Fax    +61 03 9428 0786
> > Email  william_ferguson@versata.com
> > www.versata.com
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting classpath for Taskdef

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
At the very least you'll also need Ant's optional.jar in that nested
classpath, as that is where
org.apache.tools.ant.taskdefs.optional.net.MimeMail lives.

I'm not sure that will complete fix it as I haven't tried it myself, but
that should get it a bit closer.

    Erik


----- Original Message -----
From: "William Ferguson" <wi...@versata.com>
To: "Ant User (E-mail)" <an...@jakarta.apache.org>
Sent: Sunday, December 09, 2001 6:33 PM
Subject: Setting classpath for Taskdef


> Has anyone managed to set the classpath attribute for TaskDef?
>
> Eg I wanted to get the MimeMail task to work without having to put
j2ee.jar
> into %ANT_HOME%\lib
> or specify it on the command line when invoking Ant. The doco for Taskdef
> (and some posts on
> this list) seemed to suggest that the following was correct usage.
>
> <taskdef name="mimeMail"
> classname="org.apache.tools.ant.taskdefs.optional.net.MimeMail"
> <classpath>
> <pathelement location="${project}/lib/j2ee/j2ee.jar"/>
> </classpath>
> </taskdef>
>
> where ${project}/lib/j2ee/j2ee.jar is where the j2ee.jar resides.
> But I just get "Could not create task of type: mimeMail due to
> java.lang.NoClassDefFoundError: javax/mail/Address"
>
> Any suggestions?
>
>
>
> William Ferguson
> Technical Lead - Workflow Functionality
> Versata, Inc.
> "Business Logic Development and Management"
> Ph     +61 03 9428 0788
> Fax    +61 03 9428 0786
> Email  william_ferguson@versata.com
> www.versata.com
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>