I wrapped it with MimeMessageWrapper and it still crashed.
The culprit is inside javax.mail
public static byte[] getBytes(InputStream is) throws IOException {
int len;
int size = 1024;
byte [] buf;
if (is instanceof ByteArrayInputStream) {
size = is.available();
buf = new byte[size];
len = is.read(buf, 0, size);
}
else {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
buf = new byte[size];
while ((len = is.read(buf, 0, size)) != -1)
bos.write(buf, 0, len);
buf = bos.toByteArray();
}
return buf;
}
-------------------
The
while ((len = is.read(buf, 0, size)) != -1)
bos.write(buf, 0, len);
mysteriously throw exception on bos.write(buf, 0, len);
in the middle of the big file size.
Anything I should do with the java VM args?
I used 1GB RAM, AMD 64, Fedore x86_64 and Sun Jdk 1.5_06
On 12/30/05, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
>
> Where is the stack trace?
> We need at least to know the Exception type and the error message.
> The logfile would also help.
>
> Maybe the problem is that message.getFlags() was not wrapped in the
> MimeMessageWrapper for 2.2.0. I committed yesterday a patch to
> MimeMessageWrapper adding a few missing wrapping methods.
>
> Stefano
>
> Edward Tan wrote:
> > Hi,
> >
> > James suddenly crash when I receive > 30MB attachment. I didn't check
> the
> > threshold of message size that causes this. I just happened to send 34
> MB
> > attachment through Thunderbird to James. The problem is caused by my
> mailet
> > which tries to get the flag:
> >
> >
> > in my my mailet:
> >
> > message = mail.getMessage();
> >
> > .....
> >
> >
> > // FLAGS
> > ---> (exception when calling this:) Flags flags =
> > message.getFlags();
> >
> >
> > The exception is caught in org.apache.james.transport.JamesSpoolManager
> >
> > line 233:
> > } catch (Throwable e) {
> > // This is a strange error situation that shouldn't
> > ordinarily
> > // happen
> > StringBuffer exceptionBuffer =
> > new StringBuffer(64)
> > .append("Exception in processor <")
> > .append(processorName)
> > .append(">");
> > getLogger().error(exceptionBuffer.toString(), e);
> > if (processorName.equals(Mail.ERROR)) {
> > // We got an error on the error processor...
> > // kill the message
> > mail.setState(Mail.GHOST);
> > mail.setErrorMessage(e.getMessage());
> >
> >
> > Has anyone experienced before?
> >
> > Any limit on message size?
> >
> > Regards,
> > Edward
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>