【问题标题】:Issue with using the antbuilder mail task in groovy 1.7.2在 groovy 1.7.2 中使用 antbuilder 邮件任务的问题
【发布时间】:2012-05-02 03:40:10
【问题描述】:

我最近在 groovy 中使用 antbuilder 邮件任务时遇到问题。它总是抛出以下异常:

[mail] 发送邮件:null

[mail] 发送邮件失败:0

捕获: : java.lang.ArrayIndexOutOfBoundsException: 0

我认为问题只是在新的 1.7.2 版本发布时出现的,但我不能确定。

这里是sn-p:

ant = new AntBuilder()
ant.mail(mailhost:'localhost',mailport:'25',subject:'Hello Ant World',messagemimetype:'text/html') {
 from(address:'changed@to.protect.the.innocent')
 to(address:'changed@to.protect.the.innocent')
 message('Hello ant world!')
}

知道如何让它工作吗? 谢谢,英戈

【问题讨论】:

    标签: ant groovy email


    【解决方案1】:

    我发现问题在于我的类路径中有 GroovyWS。见:http://jira.codehaus.org/browse/GMOD-55

    【讨论】:

    • 请在此处将该链接中的相关内容添加到您的答案中。考虑一下如果链接断开,你的答案会有什么用处。
    【解决方案2】:

    是的,你完全正确。只需删除那个罐子就可以了。谢谢。但是由于我使用了 groovyws 库,所以我不得不使用普通的 javax.mail 代码来解决它......

    【讨论】:

      猜你喜欢
      • 2012-12-22
      • 1970-01-01
      • 2013-02-15
      • 2013-08-07
      • 1970-01-01
      • 2012-01-22
      • 2011-01-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多