The service code is as follows: I have only inclued the part where the
problem occurs. From what I can tell in all logging, is that it enters the
mailet, it logs the message: 'Copying to MimeMessage', then I get the
java.lang.OutOfMemoryError and it never logs the 'Message getSize' line. As
I said previously, it only does this on messages with large attachments.
public void service(Mail mail) throws MessagingException {
try {
log("Copying to MimeMessage");
MimeMessage message = mail.getMessage();
log("Message getSize()" + message.getSize());
. . .
catch (Exception e) {
log("Exception: "
+ e.getMessage(), e);
throw new MessagingException("Exception thrown", e);
}
}
Kraig
----- Original Message -----
From: "Corey A. Johnson" <[EMAIL PROTECTED]>
To: "James Users List" <[EMAIL PROTECTED]>
Sent: Monday, December 29, 2003 10:26 AM
Subject: Re: Determine Message Size in Mailet
> Weird problem. I am doing the same thing in a mailet.. without any
> issues. But i am running on Solaris 8 for SPARC.
>
> can you email to list the service method code for your mailet?
>
> Cj
>
> Kraig Schario wrote:
>
> >I am having a problem with a mailet when copying the Mail mail object to
a
> >MimeMessage.
> >
> > MimeMessage message = mail.getMessage();
> >
> >It only occurs when the message contains large attachments. Usually
larger
> >than 2 MB. I receive the following error in the Mailet.log
> >
> > java.lang.OutOfMemoryError
> >
> >And the message is sent to the Error Processor.
> >
> >Is there a way to test the size of the mail object before copying it to a
> >MimeMessage to access the getSize() method?
> >
> >I experience the problem in both James 2.1.3 and James 2.2.0a15. Runing
on
> >RedHat 9 or on Windows XP and 2000. The systems have 512 MB and 1.8GHz
> >processors, so I don't think it is resource related. I am using Sun Java
> >version j2re1.4.2_03
> >
> >Thanks
> >
> >
> >Kraig Schario
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
> --
> Corey A. Johnson
> Creative Network Innovations
> http://www.cniweb.net/
> 1-800-CNi-5547 ** 1-321-259-1984
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]