You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/03/29 17:22:50 UTC

DO NOT REPLY [Bug 53004] New: Mail task fails with Java 7

https://issues.apache.org/bugzilla/show_bug.cgi?id=53004

             Bug #: 53004
           Summary: Mail task fails with Java 7
           Product: Ant
           Version: 1.8.3
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: nanthomp1@gmail.com
    Classification: Unclassified


I have ant 1.8.3 installed with all optional jars in it's lib directory (I ran
fetch to retrieve them).

I've created a simple mail task as shown below (mailhost and email addresses
were valid).

  <target name="mailtest" description="Test of javamail">        
    <echo message="Attempting to send email"/>
    <mail mailhost="my.mailserver.com" mailport="25" subject="Test build">
      <from address="myname@email.com"/>
      <to address="myname@email.com"/>
      <message>Test</message>
    </mail>
  </target>

The task works perfectly when my JAVA_HOME points to Java 6 (jdk1.6.0_31) but
when I change it to Java 7 (jdk1.7.0_03) I get the Exception
SMTPSendFailedException: 354 go ahead.

Stack Trace shown below ...

c:\opt\ntc\include\testtargets.xml:85: Problem while sending mime mail:
    at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:444)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    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:392)
    at org.apache.tools.ant.Target.performTasks(Target.java:413)
    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:811)
    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)
Caused by: c:\opt\ntc\include\testtargets.xml:85: Problem while sending mime
mail:
    at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:261)
    at
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:577)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    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:392)
    at org.apache.tools.ant.Target.performTasks(Target.java:413)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
    ... 16 more
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 354 go ahead

    at
com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
    at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1215)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:586)
    at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:258)
    ... 29 more

We use the same functionality in our application using Java 7 (although we use
the Transport.send() static method to send MIME mail rather than the
transport.sendMessage() method) without an issue (so this could potentially be
an issue with Java 7 instead).

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

[Bug 53004] Mail task fails with Java 7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53004

Nan Thompson <na...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.