Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via ant-user by Patrick Martin, 1 year ago
-->        <pathelement location="a/mail.jar" />        <pathelement location="a/activation.jar" /> </classpath> > </taskdef> > > But it did not work. I keep on getting the following error: > > D:\tmp\build.xml:7: taskdef A class needed by class > org.apache.tools.ant.taskdefs.email.MimeMailer cannot be found: > javax/mail/MessagingException >  using the classloader AntClassLoader[D:\tmp\a\activation.jar]
java.lang.ClassNotFoundException: javax.activation.DataHandler
Thanks,
Patrick
On Wed, Jan 19, 2011 at 10:31 AM, Patrick Martin <antuser@gmail.com> wrote:
> Hello,
>
> Is it possible to use the <mail> task without having activation.jar
> and mail.jar in the ant lib folder?
>
> I tried to redefine the mail task this way:
>
> <taskdef name="mymail"
> classname="org.apache.tools.ant.taskdefs.email.MimeMailer">
<classpath>
        <pathelement location="${ant.home}/lib/ant-javamail.jar" /> <!--
> same with and without this line -->
        <pathelement location="a/mail.jar" />
        <pathelement location="a/activation.jar" />
</classpath>
> </taskdef>
>
> But it did not work. I keep on getting the following error:
>
> D:\tmp\build.xml:7: taskdef A class needed by class
> org.apache.tools.ant.taskdefs.email.MimeMailer cannot be found:
> javax/mail/MessagingException
>  using the classloader AntClassLoader[D:\tmp\a\activation.jar]	at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:627)	at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:239)	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:585)	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)	at org.apache.tools.ant.Task.perform(Task.java:348)	at org.apache.tools.ant.Target.execute(Target.java:390)	at org.apache.tools.ant.Target.performTasks(Target.java:411)	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)	at org.apache.tools.ant.Main.runBuild(Main.java:809)	at org.apache.tools.ant.Main.startAnt(Main.java:217)	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)