0

我刚刚在 Windows 上下载并设置了 Apache James 3 最新的 beta 版本,到目前为止我还无法发送简单的消息。看起来构建存在问题。错误是 -

ERROR 22:45:01,666 | james.mailspooler | Exception processing mail while spooling Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl@4262d5d7])
javax.mail.MessagingException: Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl@4262d5d7])
.
.
Caused by: javax.mail.MessagingException: Unable to process mail Mail1442234701295-757cd62b-eeed-4671-828c-2a7c715acfaa (org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl@4262d5d7])
.
.
Caused by: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: org.apache.james.core.MailImpl@4262d5d7]
.
.
Caused by: java.lang.NoSuchMethodError: org.apache.james.mime4j.stream.MimeConfig: method <init>()V not found

JAR 中的相关类显示了所谓的缺失构造函数,所以我完全不知所措。任何人都可以指导我正确的方向吗?

提前致谢!

编辑:来自 MimeConfig 类的反编译代码片段显示了构造函数

public final class MimeConfig {
  /* member class not found */
  class Builder {}
.
.
  MimeConfig(boolean strictParsing, int maxLineLen, int maxHeaderCount, int maxHeaderLen, long maxContentLen, boolean countLineNumbers, 
                String headlessParsing, boolean malformedHeaderStartsBody) {
/*  53*/        this.strictParsing = strictParsing;
/*  54*/        this.countLineNumbers = countLineNumbers;
/*  55*/        this.malformedHeaderStartsBody = malformedHeaderStartsBody;
/*  56*/        this.maxLineLen = maxLineLen;
/*  57*/        this.maxHeaderCount = maxHeaderCount;
/*  58*/        this.maxHeaderLen = maxHeaderLen;
/*  59*/        this.maxContentLen = maxContentLen;
/*  60*/        this.headlessParsing = headlessParsing;
        }
4

2 回答 2

0

解决方案是使用:apache-mime4j-core-0.7.2.jarapache-mime4j-dom-0.7.2.jar

下载这两个 jar 并将它们放入:james-server-app-3.0.0-beta5-SNAPSHOT\lib。

您可以从以下网址下载 james-server-app-3.0.0-beta5:https ://repository.apache.org/content/repositories/snapshots/org/apache/james/james-server-app/3.0.0-beta5-快照/

于 2016-08-16T14:17:17.710 回答
0

我遇到了同样的错误,正在寻找答案。该错误是因为 MimeConfig 没有默认构造函数。通过执行以下操作,我可以在本地成功发送邮件。

  1. 已下载 apache-mime4j-core-0.8.0-20150617.024907-738-sources
  2. 为 MimeConfig 创建了一个默认的公共构造函数
  3. 使用静态类 Builder 构造函数中显示的值初始化所有变量
  4. 为所有变量添加了设置器(因为我得到了 setMaxLineLen 的 NoSuchMethodError)
  5. 创建了一个名为 apache-mime4j-0.8.0-fix.jar 的 jar 并推入 lib 文件夹
  6. 我使用run.sh,所以用上面的替换了mime4j核心jar名称。

我确信 spooler 和 mime4j 之间存在一些不匹配。我认为调用代码应该使用 Builder 而不是直接尝试实例化 MimeConfig。

试试这些,让我知道它是否有效。它对我有用。我不确定这是否是永久修复,但我可以继续探索 V3 功能,直到我们获得永久解决方案。

于 2016-07-05T06:25:49.697 回答