0

I just downloaded and setup the Apache James 3 latest beta release on Windows and so far i haven't been able to send a simple message. It looks like there is an issue with the build. The error is -

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

The relevant class in the JAR shows the supposedly missing constructor so i am at a complete loss. Can anyone guide me in the right direction please?

Thanks in advance!

Edit: Decompiled code snippet from the MimeConfig class shows the constructor

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;
        }
Jay
  • 1,392
  • 7
  • 17
  • 44
  • Posting your code will help people understand it more clearly. – Techidiot Sep 14 '15 at 13:02
  • "The relevant class in the JAR shows the supposedly missing constructor" <-- how, specifically, did you verify this? – David P. Caldwell Sep 14 '15 at 13:15
  • It's not my code, i just created users and sent mail per the Quickstart guide https://james.apache.org/server/3/quick-start.html – Jay Sep 14 '15 at 13:31
  • @DavidP.Caldwell I looked at the source code.. – Jay Sep 14 '15 at 13:31
  • The source code may not be a valid guide here, unless you built the source code yourself and did not use some kind of binary distribution. See if you can examine the relevant classes with the `javap` command. – David P. Caldwell Sep 14 '15 at 13:37
  • True. I also decompiled the class in my installation and it looked alright. I'll add the snippet tomorrow. – Jay Sep 14 '15 at 13:44
  • I did some research on the "method ()V not found" errors. It seems to me that If the constructor is not public, it could result in that error like when instantiating an object. – Jay Sep 15 '15 at 05:08
  • The decompiled class doesn't seem to have it public, but the source code sure does - http://grepcode.com/file/repo1.maven.org/maven2/org.apache.james/apache-mime4j-core/0.7.2/org/apache/james/mime4j/stream/MimeConfig.java – Jay Sep 15 '15 at 05:14

2 Answers2

0

I got the same error and was searching for an answer. The error is because MimeConfig doesn't have a default constructor. I could get the mail successfully delivered locally by doing to following.

  1. Dowloaded apache-mime4j-core-0.8.0-20150617.024907-738-sources
  2. Created a default public constructor for MimeConfig
  3. Initialized all the variables with values shown in the static class Builder constructor
  4. Added setters for all the variables (Because I was getting NoSuchMethodError for setMaxLineLen)
  5. Created a jar called apache-mime4j-0.8.0-fix.jar and pushed into the lib folder
  6. I use run.sh, so replaced the mime4j core jar name with the above one.

I am sure there is some mismatch between spooler and mime4j. I think the calling code should use the Builder instead of directly trying to instantiate the MimeConfig.

Try these and let me know if it works. It worked for me. I am not sure if this is a permanent fix, but I can go ahead with exploring the V3 features till we get a permanent solution.

Mahesh
  • 1
  • 1
  • 1
0

The solution is to use the : apache-mime4j-core-0.7.2.jar and apache-mime4j-dom-0.7.2.jar

download the two jars and put them in : james-server-app-3.0.0-beta5-SNAPSHOT\lib.

You can download james-server-app-3.0.0-beta5 from : https://repository.apache.org/content/repositories/snapshots/org/apache/james/james-server-app/3.0.0-beta5-SNAPSHOT/.