I am using Apache James 3.0.4
Don't you mean Apach James 3.0-beta4? i.e. we haven't yet reached 3.0 release, so there is no 3.0.4. Any reason you're not using the stable release (2.3.2)? Just asking... :-)
I logged before and after appendMessages, but noticed that the second log is absent.
If you never get to logging code just after folder.appendMessages(new Message[] {mimeMessage});, then there are three possibilities:
- An Error (or Throwable) is being thrown inside javax.mail / IO code.
Examples include IOError (nasty IO interfacing failure), LinkageError (incompatible jars/classes) or CoderMalfunctionError (thrown by CharsetDecoder or CharsetEncoder if the decoding/encoding loop throws an unexpected exception). - Thread problems cause your program to reach a standstill - i.e. thread starvation or deadlock
- JVM process crash
Item (1) is by far the most probable here. Suggestion: change tail-end of code to:
} catch (Exception e) {
logger.error(e);
} catch (Throwable t) {
logger.error(t);
} finally {
closeMailStore(store, folder); // just simple method which closes the store
}
IF this then logs a throwable, you can investigate the cause in terms of app jars & configuration, OS/JVM version, or data content...
IF this doesn't log a throwable, you can investigate (2) or (3).