ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42389] Ant "Mail" task fails to send mail if "encoding" isn't provided (and Auto selects "Mime" type)
Date Tue, 30 Sep 2008 08:37:35 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=42389


jiro <jiro@sysart.jp> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1




--- Comment #1 from jiro <jiro@sysart.jp>  2008-09-30 01:37:35 PST ---
EmailTask is executed by using org.apache.tools.ant.taskdefs.email.Mailer that
has encoding "auto" as default.
If encoding is not specified, org.apache.tools.ant.taskdefs.email.MimeMailer 
is set to the Mailer (when encoding is not "plain").
Because MimeMailer imports javax.mail package that is not bundled with ant-1.7,
linkage error occurs  like below.

    [mail] Class org.apache.tools.ant.taskdefs.email.MimeMailer could not be 
loaded because of an invalid dependency.
    [mail]     at 
org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:296)
    [mail]     at 
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:418)
    [mail]     at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [mail]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
    [mail]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [mail]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [mail]     at java.lang.reflect.Method.invoke(Method.java:585)
    [mail]     at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    [mail]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [mail]     at org.apache.tools.ant.Target.execute(Target.java:361)
    [mail]     at org.apache.tools.ant.Target.performTasks(Target.java:389)
    [mail]     at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
    [mail]     at 
org.apache.tools.ant.Project.executeTarget(Project.java:1304)
    [mail]     at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    [mail]     at 
org.apache.tools.ant.Project.executeTargets(Project.java:1186)
    [mail]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
    [mail]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
    [mail]     at 
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    [mail]     at 
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    [mail] Caused by: java.lang.NoClassDefFoundError: 
javax/mail/MessagingException
    [mail]     at java.lang.Class.forName0(Native Method)
    [mail]     at java.lang.Class.forName(Class.java:242)
    [mail]     at 
org.apache.tools.ant.util.ClasspathUtils.newInstance(ClasspathUtils.java:266)
    [mail]     ... 18 more

I think if you use email task without specify encoding, you must include 
mail.jar in the library classpath.
activation.jar is required also.

See http://ant.apache.org/manual/index.html "Library Dependencies"


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message