You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Markus <ma...@yahoo.de> on 2011/07/29 16:32:30 UTC
Problems with classloader
Hi all,
I am launching ant within Java Code. To be more precise I launch it from a Servlet which is invoked from the Servlet Engine Jetty.
I want to launch the "mail" task and I obtain the following error:
Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
This is a known problem and the solution is to add the mail and activation.jar either by specifying in the lib options or in home/.ant/lib.
I did this and when launching the target from shell via ant or within eclipse it works fine, but when launching within java, I obtain this error.
Any Idea, how I have to specify the classes?
many thanks for your help
cheers markus
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Problems with classloader
Posted by Rainer Noack <ra...@noacks.net>.
Hi, depends on how you launch ant from java.
ant-style classpath reordering/resolution ("-lib option", ANT_HOME and
so on) is done in the Launcher.
If you just call Ant's Main class, you have to add the required jars in
your application's (system-)classpath.
Cheers
Rainer
Am 29.07.2011 16:32, schrieb Markus:
> Hi all,
>
> I am launching ant within Java Code. To be more precise I launch it from a Servlet which is invoked from the Servlet Engine Jetty.
>
> I want to launch the "mail" task and I obtain the following error:
>
> Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer
>
> This is a known problem and the solution is to add the mail and activation.jar either by specifying in the lib options or in home/.ant/lib.
> I did this and when launching the target from shell via ant or within eclipse it works fine, but when launching within java, I obtain this error.
>
> Any Idea, how I have to specify the classes?
>
> many thanks for your help
>
> cheers markus
>
> ---------------------------------------------------------------------
> 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