Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-466

java.sql.SQLException: Error reading from InputStream java.io.IOException in current trunk

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Labels:
      None
    • Environment:
      java 1.5, mysql-connector-java-3.0.17-ga-bin.jar

      Description

      After upgrading to latest trunk i notice this exception about 8 times today:

      01/04/06 21:52:53 ERROR spoolmanager: Exception in processor <transport>
      javax.mail.MessagingException: Exception caught while storing mail Container: ;
      nested exception is:
      java.sql.SQLException: Error reading from InputStream java.io.IOException
      at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755)
      at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
      at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
      at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
      at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
      at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
      at java.lang.Thread.run(Thread.java:595)
      01/04/06 21:52:53 ERROR spoolmanager: An error occurred processing Mail1143921172623-45 through transport
      01/04/06 21:52:53 ERROR spoolmanager: Result was error

      Whats the Problem ? Should i upgrade the mysql-connector ?

      1. james-bug2.txt
        5 kB
        Norman Maurer
      2. MailRepostitory.patch
        2 kB
        Norman Maurer

        Activity

        Hide
        norman Norman Maurer added a comment -

        After upgrading to mysql-connector-java-3.1.12 i don't had this issue again .. I will report if i see this issue again.

        Show
        norman Norman Maurer added a comment - After upgrading to mysql-connector-java-3.1.12 i don't had this issue again .. I will report if i see this issue again.
        Hide
        norman Norman Maurer added a comment -

        now i see some :

        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected

        some really strange goes on here in the current trunk..

        Show
        norman Norman Maurer added a comment - now i see some : java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected some really strange goes on here in the current trunk..
        Hide
        norman Norman Maurer added a comment -

        Here is the the stacktrace:

        03/04/06 23:44:43 ERROR spoolmanager: Exception in processor <transport>
        javax.mail.MessagingException: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755)
        at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
        at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)
        03/04/06 23:44:43 ERROR spoolmanager: An error occurred processing Mail1144100682600-66 through transport

        Show
        norman Norman Maurer added a comment - Here is the the stacktrace: 03/04/06 23:44:43 ERROR spoolmanager: Exception in processor <transport> javax.mail.MessagingException: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755) at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236) at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595) 03/04/06 23:44:43 ERROR spoolmanager: An error occurred processing Mail1144100682600-66 through transport
        Hide
        bago Stefano Bagnara added a comment -

        Norman, I committed a fast patch adding the stack trace logging to 2 catch clauses.

        Did you see the exception only starting from RemoteDelivery or from other code calling the spool.store() method, also?

        Show
        bago Stefano Bagnara added a comment - Norman, I committed a fast patch adding the stack trace logging to 2 catch clauses. Did you see the exception only starting from RemoteDelivery or from other code calling the spool.store() method, also?
        Hide
        norman Norman Maurer added a comment -

        I only see i in RemoteDelivery.. But i use james only as gateway so its the only thing it do.. I will checkout the current trunk and test it with that to see what the problem is.

        Show
        norman Norman Maurer added a comment - I only see i in RemoteDelivery.. But i use james only as gateway so its the only thing it do.. I will checkout the current trunk and test it with that to see what the problem is.
        Hide
        norman Norman Maurer added a comment -

        Here is the stacktrace:

        06/04/06 20:59:24 ERROR spoolmanager.virus: Exception calling ToRepository: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        javax.mail.MessagingException: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755)
        at org.apache.james.transport.mailets.ToRepository.service(ToRepository.java:96)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2279)
        at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1247)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1043)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:773)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:743)
        at org.apache.james.transport.mailets.ToRepository.service(ToRepository.java:96)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)

        Show
        norman Norman Maurer added a comment - Here is the stacktrace: 06/04/06 20:59:24 ERROR spoolmanager.virus: Exception calling ToRepository: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected javax.mail.MessagingException: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755) at org.apache.james.transport.mailets.ToRepository.service(ToRepository.java:96) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595) java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2279) at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1247) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1043) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:773) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168) at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:743) at org.apache.james.transport.mailets.ToRepository.service(ToRepository.java:96) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595)
        Hide
        bago Stefano Bagnara added a comment -

        Thank you for the tests, unfortunately I'm not able to reproduce it in a test.
        Can you change the throwException() method of MessageInputStream adding printStackTrace() for the exception caught?

        private void throwException() throws IOException {
        try {
        if (wrapped == null)

        { throw new IOException("wrapped stream does not exists anymore"); }

        else if (caughtException instanceof IOException)

        { ---> caughtException.printStackTrace(); throw (IOException) caughtException; }

        else {
        ---> caughtException.printStackTrace();
        throw new IOException("Exception caugth in worker thread "+caughtException.getMessage()) {
        /**

        • @see java.lang.Throwable#getCause()
          */
          public Throwable getCause() { return caughtException; }

          };
          }
          } finally

          { caughtException = null; wrapped = null; }

          }

        The jdbc driver ate the stacktrace at "ServerPreparedStatement.storeStream".

        The problem is in the new pipe code. It is used only with messages greater than 4KB: can you check if you get this error for EVERY message greater than 4kb or only few of them? What mysql server version are you using?

        I see that the last exception is from the ToRepository and not from the RemoteDelivery: this is good because we now know (almost for sure) that the problem is in the store code and not somewhere else.

        Show
        bago Stefano Bagnara added a comment - Thank you for the tests, unfortunately I'm not able to reproduce it in a test. Can you change the throwException() method of MessageInputStream adding printStackTrace() for the exception caught? private void throwException() throws IOException { try { if (wrapped == null) { throw new IOException("wrapped stream does not exists anymore"); } else if (caughtException instanceof IOException) { ---> caughtException.printStackTrace(); throw (IOException) caughtException; } else { ---> caughtException.printStackTrace(); throw new IOException("Exception caugth in worker thread "+caughtException.getMessage()) { /** @see java.lang.Throwable#getCause() */ public Throwable getCause() { return caughtException; } }; } } finally { caughtException = null; wrapped = null; } } The jdbc driver ate the stacktrace at "ServerPreparedStatement.storeStream". The problem is in the new pipe code. It is used only with messages greater than 4KB: can you check if you get this error for EVERY message greater than 4kb or only few of them? What mysql server version are you using? I see that the last exception is from the ToRepository and not from the RemoteDelivery: this is good because we now know (almost for sure) that the problem is in the store code and not somewhere else.
        Hide
        bago Stefano Bagnara added a comment -

        What version of mysql server are you using?
        Do you use db or dbfile?
        Do you use the same repository type (db/dbfile/file) for all the repositories (inbox, spool, outgoing spool)? (if not what is the configuration).
        If you could find a way to reproduce the error it would be very useful.
        I just tested mysql 4.1 with db and dbfile and with different message sizes (from 100bytes to 16MB) and I can't reproduce this error

        Show
        bago Stefano Bagnara added a comment - What version of mysql server are you using? Do you use db or dbfile? Do you use the same repository type (db/dbfile/file) for all the repositories (inbox, spool, outgoing spool)? (if not what is the configuration). If you could find a way to reproduce the error it would be very useful. I just tested mysql 4.1 with db and dbfile and with different message sizes (from 100bytes to 16MB) and I can't reproduce this error
        Hide
        bago Stefano Bagnara added a comment -

        Another test you could try is to upgrade to connector/j 5.0.0 beta.
        I know that much of the code I wrote and not committed about reading streams from db is very much bugged in previous releases, but I saw no problems with the code for writing streams that I decided to commit.

        Show
        bago Stefano Bagnara added a comment - Another test you could try is to upgrade to connector/j 5.0.0 beta. I know that much of the code I wrote and not committed about reading streams from db is very much bugged in previous releases, but I saw no problems with the code for writing streams that I decided to commit.
        Hide
        norman Norman Maurer added a comment -

        im using mysql 4.1 and db for all repositories. Im not can reproduce it .. its really strange. I also get this error on a message that was generated by jira:

        Return-Path: <nm@spam-box.de>
        Delivered-To: nm@spam-box.de
        Received: (qmail 17883 invoked by uid 89); 9 Apr 2006 15:10:46 -0000
        Received: from localhost (HELO mail.guden.ath.cx) (127.0.0.1) by guden.ath.cx with SMTP; 9 Apr 2006 15:10:46 -0000
        Return-Path: null
        Message-ID: <17549897.1144595446588.JavaMail.root@Fileserver>
        Von: nm@spam-box.de
        An: nm@spam-box.de
        Betreff: Re:svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java
        In-Reply-To: <21563474.1144595411555.JavaMail.root@Fileserver>
        MIME-Version: 1.0
        Content-Type: multipart/mixed; boundary="----=_Part_4_29805992.1144595411786"
        Datum: Sun, 09 Apr 2006 15:06:35 -0000 (17:06 CEST)
        X-EXCUBATOR-User: nm@spam-box.de
        X-EXCUBATOR-Domain: spam-box.de
        X-EXCUBATOR-Infected: false
        X-EXCUBATOR-Processed: Sun Apr 9 17 10 46 2006
        X-EXCUBATOR-Signature: 2,443923f6178662854118679
        X-EXCUBATOR-Improbability: 1 in 230 chance of being spam
        X-EXCUBATOR-Result: Innocent
        X-EXCUBATOR-Probability: 0.0000
        X-EXCUBATOR-Confidence: 0.6963
        X-Evolution-Source: imap://nm%40spam-box.de@guden.ath.cx/

        We were unable to deliver the attached message because of an error in the mail server.

        Error message below:
        Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected

        Message details:
        Subject: svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java
        Sent date: Sun Apr 09 17:06:35 CEST 2006
        MAIL FROM: server-dev-return-15912-nm=spam-box.de@james.apache.org
        RCPT TO: nm@spam-box.de
        From: bago@apache.org
        To: server-cvs@james.apache.org
        Size (in bytes): 4821

        E-Mail-Nachricht-Anlage (svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java)

        Return-Path: null
        Received: from hiphopcorner.de ([62.75.159.71]) by mail.guden.ath.cx (JAMES SMTP Server 2.3-dev) with SMTP ID 469 for <nm@spam-box.de>; Sun, 9 Apr 2006 17:10:10 +0200 (CEST)
        Received: (qmail 20225 invoked from network); 9 Apr 2006 15:06:58 -0000
        Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by mail.spam-box.de with SMTP; 9 Apr 2006 15:06:58 -0000
        Received: (qmail 44124 invoked by uid 500); 9 Apr 2006 15:06:57 -0000
        Mailing-List: contact server-dev-help@james.apache.org; run by ezmlm
        Precedence: bulk
        List-Unsubscribe: <server-dev-unsubscribe@james.apache.org>
        List-Help: <server-dev-help@james.apache.org>
        List-Post: <server-dev@james.apache.org>
        List-Id: "James Developers List" <server-dev.james.apache.org>
        Antwort an: James Developers List <server-dev@james.apache.org>
        Delivered-To: mailing list server-dev@james.apache.org
        Received: (qmail 44106 invoked by uid 500); 9 Apr 2006 15:06:57 -0000
        Received: (qmail 44099 invoked by uid 99); 9 Apr 2006 15:06:57 -0000
        Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Apr 2006 08:06:57 -0700
        X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME
        X-Spam-Check-By: apache.org
        Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 Apr 2006 08:06:56 -0700
        Received: (qmail 86675 invoked by uid 65534); 9 Apr 2006 15:06:36 -0000
        Message-ID: <21563474.1144595411555.JavaMail.root@Fileserver>
        Content-Type: text/plain; charset="utf-8"
        MIME-Version: 1.0
        Content-Transfer-Encoding: 7bit
        Betreff: svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java
        Datum: Sun, 09 Apr 2006 15:06:35 -0000 (17:06 CEST)
        An: server-cvs@james.apache.org
        Von: bago@apache.org
        X-Mailer: svnmailer-1.0.7
        X-Virus-Checked: Checked by ClamAV on apache.org
        X-EXCUBATOR-User: nm@spam-box.de
        X-EXCUBATOR-Domain: spam-box.de
        X-EXCUBATOR-Infected: false
        X-EXCUBATOR-Processed: Sun Apr 9 17 10 11 2006
        X-EXCUBATOR-Signature: 2,443923d3177981439073897
        X-EXCUBATOR-Improbability: 1 in 231 chance of being spam
        X-EXCUBATOR-Result: Whitelisted
        X-EXCUBATOR-Probability: 0.0000
        X-EXCUBATOR-Confidence: 0.6966

        einfaches Textdokument-Anlage (svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java)

        Author: bago
        Date: Sun Apr 9 08:06:34 2006
        New Revision: 392749

        URL: http://svn.apache.org/viewcvs?rev=392749&view=rev
        Log:
        Added conservative synchronization to MimeMessageWrapper (JAMES-474)
        Hint by Martijn Brinkers

        Modified:
        james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java

        Modified: james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java
        URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java?rev=392749&r1=392748&r2=392749&view=diff
        ==============================================================================
        — james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java (original)
        +++ james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java Sun Apr 9 08:06:34 2006
        @@ -147,8 +147,8 @@

        • with data.
        • @see MimeMessageSource
          */
        • public String getSourceId() {
        • return source.getSourceId();
          + public synchronized String getSourceId() { + return source != null ? source.getSourceId() : null; }

        /**
        @@ -161,16 +161,19 @@
        if (headers != null)

        { //Another thread has already loaded these headers return; - }
        • try { - InputStream in = source.getInputStream(); + }

          else if (source != null) {
          try

          { - headers = createInternetHeaders(in); - }

          finally {

        • IOUtil.shutdownStream(in);
          + InputStream in = source.getInputStream();
          + try { + headers = createInternetHeaders(in); + }

          finally

          { + IOUtil.shutdownStream(in); + }

          + } catch (IOException ioe)

          { + throw new MessagingException("Unable to parse headers from stream: " + ioe.getMessage(), ioe); }
        • } catch (IOException ioe) { - throw new MessagingException("Unable to parse headers from stream: " + ioe.getMessage(), ioe); + }

          else

          { + throw new MessagingException("loadHeaders called for a message with no source, contentStream or stream"); }

          }

        @@ -205,14 +208,14 @@
        *

        • @return whether the message has been modified
          */
        • public boolean isModified() {
          + public synchronized boolean isModified() { return headersModified || bodyModified || modified; }

        /**

        • Rewritten for optimization purposes
          */
        • public void writeTo(OutputStream os) throws IOException, MessagingException {
          + public synchronized void writeTo(OutputStream os) throws IOException, MessagingException {
          if (!isModified()) { // We do not want to instantiate the message... just read from source // and write to this outputstream @@ -241,7 +244,7 @@ writeTo(headerOs, bodyOs, new String[0]); }
        • public void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException {
          + public synchronized void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException {
          if (!isModified()) { //We do not want to instantiate the message... just read from source // and write to this outputstream @@ -391,7 +394,7 @@ }
        • private void checkModifyHeaders() throws MessagingException {
          + private synchronized void checkModifyHeaders() throws MessagingException
          Unknown macro: { if (headers == null) { loadHeaders(); } @@ -442,10 +445,9 @@ }

        /**

        • * TODO fixme
        • @see javax.mail.internet.MimeMessage#parse(java.io.InputStream)
          */
        • protected void parse(InputStream is) throws MessagingException {
          + protected synchronized void parse(InputStream is) throws MessagingException {
          // the super implementation calls
          // headers = createInternetHeaders(is);
          super.parse(is);
          @@ -458,7 +460,7 @@
        • @see javax.mail.internet.MimeMessage#createInternetHeaders(java.io.InputStream)
          */
        • protected InternetHeaders createInternetHeaders(InputStream is) throws MessagingException {
          + protected synchronized InternetHeaders createInternetHeaders(InputStream is) throws MessagingException {

        // Keep this: skip the headers from the stream
        // we could put that code in the else and simple write an "header" skipping

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
        For additional commands, e-mail: server-dev-help@james.apache.org

        Show
        norman Norman Maurer added a comment - im using mysql 4.1 and db for all repositories. Im not can reproduce it .. its really strange. I also get this error on a message that was generated by jira: Return-Path: <nm@spam-box.de> Delivered-To: nm@spam-box.de Received: (qmail 17883 invoked by uid 89); 9 Apr 2006 15:10:46 -0000 Received: from localhost (HELO mail.guden.ath.cx) (127.0.0.1) by guden.ath.cx with SMTP; 9 Apr 2006 15:10:46 -0000 Return-Path: null Message-ID: <17549897.1144595446588.JavaMail.root@Fileserver> Von: nm@spam-box.de An: nm@spam-box.de Betreff: Re:svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java In-Reply-To: <21563474.1144595411555.JavaMail.root@Fileserver> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4_29805992.1144595411786" Datum: Sun, 09 Apr 2006 15:06:35 -0000 (17:06 CEST) X-EXCUBATOR-User: nm@spam-box.de X-EXCUBATOR-Domain: spam-box.de X-EXCUBATOR-Infected: false X-EXCUBATOR-Processed: Sun Apr 9 17 10 46 2006 X-EXCUBATOR-Signature: 2,443923f6178662854118679 X-EXCUBATOR-Improbability: 1 in 230 chance of being spam X-EXCUBATOR-Result: Innocent X-EXCUBATOR-Probability: 0.0000 X-EXCUBATOR-Confidence: 0.6963 X-Evolution-Source: imap://nm%40spam-box.de@guden.ath.cx/ We were unable to deliver the attached message because of an error in the mail server. Error message below: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected Message details: Subject: svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java Sent date: Sun Apr 09 17:06:35 CEST 2006 MAIL FROM: server-dev-return-15912-nm=spam-box.de@james.apache.org RCPT TO: nm@spam-box.de From: bago@apache.org To: server-cvs@james.apache.org Size (in bytes): 4821 E-Mail-Nachricht-Anlage (svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java) Return-Path: null Received: from hiphopcorner.de ( [62.75.159.71] ) by mail.guden.ath.cx (JAMES SMTP Server 2.3-dev) with SMTP ID 469 for <nm@spam-box.de>; Sun, 9 Apr 2006 17:10:10 +0200 (CEST) Received: (qmail 20225 invoked from network); 9 Apr 2006 15:06:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by mail.spam-box.de with SMTP; 9 Apr 2006 15:06:58 -0000 Received: (qmail 44124 invoked by uid 500); 9 Apr 2006 15:06:57 -0000 Mailing-List: contact server-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: < server-dev-unsubscribe@james.apache.org > List-Help: < server-dev-help@james.apache.org > List-Post: < server-dev@james.apache.org > List-Id: "James Developers List" <server-dev.james.apache.org> Antwort an: James Developers List <server-dev@james.apache.org> Delivered-To: mailing list server-dev@james.apache.org Received: (qmail 44106 invoked by uid 500); 9 Apr 2006 15:06:57 -0000 Received: (qmail 44099 invoked by uid 99); 9 Apr 2006 15:06:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Apr 2006 08:06:57 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 Apr 2006 08:06:56 -0700 Received: (qmail 86675 invoked by uid 65534); 9 Apr 2006 15:06:36 -0000 Message-ID: <21563474.1144595411555.JavaMail.root@Fileserver> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Betreff: svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java Datum: Sun, 09 Apr 2006 15:06:35 -0000 (17:06 CEST) An: server-cvs@james.apache.org Von: bago@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-EXCUBATOR-User: nm@spam-box.de X-EXCUBATOR-Domain: spam-box.de X-EXCUBATOR-Infected: false X-EXCUBATOR-Processed: Sun Apr 9 17 10 11 2006 X-EXCUBATOR-Signature: 2,443923d3177981439073897 X-EXCUBATOR-Improbability: 1 in 231 chance of being spam X-EXCUBATOR-Result: Whitelisted X-EXCUBATOR-Probability: 0.0000 X-EXCUBATOR-Confidence: 0.6966 einfaches Textdokument-Anlage (svn commit: r392749 - /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java) Author: bago Date: Sun Apr 9 08:06:34 2006 New Revision: 392749 URL: http://svn.apache.org/viewcvs?rev=392749&view=rev Log: Added conservative synchronization to MimeMessageWrapper ( JAMES-474 ) Hint by Martijn Brinkers Modified: james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java Modified: james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java?rev=392749&r1=392748&r2=392749&view=diff ============================================================================== — james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java (original) +++ james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java Sun Apr 9 08:06:34 2006 @@ -147,8 +147,8 @@ with data. @see MimeMessageSource */ public String getSourceId() { return source.getSourceId(); + public synchronized String getSourceId() { + return source != null ? source.getSourceId() : null; } /** @@ -161,16 +161,19 @@ if (headers != null) { //Another thread has already loaded these headers return; - } try { - InputStream in = source.getInputStream(); + } else if (source != null) { try { - headers = createInternetHeaders(in); - } finally { IOUtil.shutdownStream(in); + InputStream in = source.getInputStream(); + try { + headers = createInternetHeaders(in); + } finally { + IOUtil.shutdownStream(in); + } + } catch (IOException ioe) { + throw new MessagingException("Unable to parse headers from stream: " + ioe.getMessage(), ioe); } } catch (IOException ioe) { - throw new MessagingException("Unable to parse headers from stream: " + ioe.getMessage(), ioe); + } else { + throw new MessagingException("loadHeaders called for a message with no source, contentStream or stream"); } } @@ -205,14 +208,14 @@ * @return whether the message has been modified */ public boolean isModified() { + public synchronized boolean isModified() { return headersModified || bodyModified || modified; } /** Rewritten for optimization purposes */ public void writeTo(OutputStream os) throws IOException, MessagingException { + public synchronized void writeTo(OutputStream os) throws IOException, MessagingException { if (!isModified()) { // We do not want to instantiate the message... just read from source // and write to this outputstream @@ -241,7 +244,7 @@ writeTo(headerOs, bodyOs, new String[0]); } public void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException { + public synchronized void writeTo(OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException { if (!isModified()) { //We do not want to instantiate the message... just read from source // and write to this outputstream @@ -391,7 +394,7 @@ } private void checkModifyHeaders() throws MessagingException { + private synchronized void checkModifyHeaders() throws MessagingException Unknown macro: { if (headers == null) { loadHeaders(); } @@ -442,10 +445,9 @@ } /** * TODO fixme @see javax.mail.internet.MimeMessage#parse(java.io.InputStream) */ protected void parse(InputStream is) throws MessagingException { + protected synchronized void parse(InputStream is) throws MessagingException { // the super implementation calls // headers = createInternetHeaders(is); super.parse(is); @@ -458,7 +460,7 @@ @see javax.mail.internet.MimeMessage#createInternetHeaders(java.io.InputStream) */ protected InternetHeaders createInternetHeaders(InputStream is) throws MessagingException { + protected synchronized InternetHeaders createInternetHeaders(InputStream is) throws MessagingException { // Keep this: skip the headers from the stream // we could put that code in the else and simple write an "header" skipping --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org For additional commands, e-mail: server-dev-help@james.apache.org
        Hide
        norman Norman Maurer added a comment -

        I upgrade the mysql conector to 5.0 beta and still get the error:

        10/04/06 09:09:58 ERROR spoolmanager.transport: Exception calling RemoteDelivery: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        javax.mail.MessagingException: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755)
        at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
        at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
        at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2378)
        at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1295)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1047)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:684)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:768)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:743)
        at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
        at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)

        10/04/06 09:09:58 ERROR spoolmanager: Exception in processor <transport>
        javax.mail.MessagingException: Exception caught while storing mail Container: ;
        nested exception is:
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755)
        at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
        at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)
        10/04/06 09:09:58 ERROR spoolmanager: An error occurred processing Mail1144652997308-5 through transport
        10/04/06 09:09:58 ERROR spoolmanager: Result was error

        Show
        norman Norman Maurer added a comment - I upgrade the mysql conector to 5.0 beta and still get the error: 10/04/06 09:09:58 ERROR spoolmanager.transport: Exception calling RemoteDelivery: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected javax.mail.MessagingException: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755) at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236) at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595) java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2378) at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1295) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1047) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:684) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:768) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168) at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:743) at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236) at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595) 10/04/06 09:09:58 ERROR spoolmanager: Exception in processor <transport> javax.mail.MessagingException: Exception caught while storing mail Container: ; nested exception is: java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:755) at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236) at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595) 10/04/06 09:09:58 ERROR spoolmanager: An error occurred processing Mail1144652997308-5 through transport 10/04/06 09:09:58 ERROR spoolmanager: Result was error
        Hide
        norman Norman Maurer added a comment -

        I add some things to log sizes.. here it is:

        16/04/06 10:43:36 INFO mailstore: messageExists: false
        16/04/06 10:43:36 INFO mailstore: name: Mail1145177016265-135 - size: 2090
        16/04/06 10:43:36 INFO mailstore: name: Mail1145177016265-135 - baos: 82
        16/04/06 10:43:36 INFO mailstore: messageExists: false
        16/04/06 10:43:36 INFO mailstore: name: Mail1145177016466-136 - size: 2179
        16/04/06 10:43:36 INFO mailstore: name: Mail1145177016466-136 - baos: 82
        16/04/06 10:43:37 INFO mailstore: messageExists: true
        16/04/06 10:43:37 INFO mailstore: messageExists: false
        16/04/06 10:43:37 INFO mailstore: name: Mail1145177016466-136 - size: 7632
        16/04/06 10:43:37 INFO mailstore: name: Mail1145177016466-136 - baos: 451
        16/04/06 10:43:37 ERROR mailstore: Exception caught while storing mail Container
        java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
        at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2378)
        at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1295)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1047)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:684)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:768)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
        at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:751)
        at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236)
        at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001)
        at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
        at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
        at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
        at java.lang.Thread.run(Thread.java:595)

        Show
        norman Norman Maurer added a comment - I add some things to log sizes.. here it is: 16/04/06 10:43:36 INFO mailstore: messageExists: false 16/04/06 10:43:36 INFO mailstore: name: Mail1145177016265-135 - size: 2090 16/04/06 10:43:36 INFO mailstore: name: Mail1145177016265-135 - baos: 82 16/04/06 10:43:36 INFO mailstore: messageExists: false 16/04/06 10:43:36 INFO mailstore: name: Mail1145177016466-136 - size: 2179 16/04/06 10:43:36 INFO mailstore: name: Mail1145177016466-136 - baos: 82 16/04/06 10:43:37 INFO mailstore: messageExists: true 16/04/06 10:43:37 INFO mailstore: messageExists: false 16/04/06 10:43:37 INFO mailstore: name: Mail1145177016466-136 - size: 7632 16/04/06 10:43:37 INFO mailstore: name: Mail1145177016466-136 - baos: 451 16/04/06 10:43:37 ERROR mailstore: Exception caught while storing mail Container java.sql.SQLException: Error while reading binary stream: java.io.IOException: Pipe not connected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ServerPreparedStatement.storeStream(ServerPreparedStatement.java:2378) at com.mysql.jdbc.ServerPreparedStatement.serverLongData(ServerPreparedStatement.java:1295) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1047) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:684) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:768) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168) at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:751) at org.apache.james.mailrepository.JDBCSpoolRepository.store(JDBCSpoolRepository.java:236) at org.apache.james.transport.mailets.RemoteDelivery.service(RemoteDelivery.java:1001) at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414) at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397) at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306) at java.lang.Thread.run(Thread.java:595)
        Hide
        bago Stefano Bagnara added a comment -

        Can you tell me where did you add the size/baos/messageExists logs?
        The weird thing here is that you have the same mail stored twice with 2 different size/baos: can you post your config.xml?

        From the stacktrace I see the repository.store() method has been called by the RemoteDelivery, and looking at the message name I guess you have a gateway configured: am I right? Otherwise the mail names should end by "to<recipientdomainname>"

        Can you add a few debug lines to the MessageInputStream class (log the message name and the full stack trace in the "} catch (IOException e) {" block in the pipedstream handling Thread. (MessageInputStream:67)
        You may consider adding logs to the throwException() method (MessageInputStream:126).

        Have you identified a "problematic" message so that we can try reproducing this?

        Another test could be to add a debug mailet just before the RemoteDelivery. Something like the DumpSystemErr but saving the message to a file named like the mail.getName() (instead of System.err) so that it logs every mail it process.

        Show
        bago Stefano Bagnara added a comment - Can you tell me where did you add the size/baos/messageExists logs? The weird thing here is that you have the same mail stored twice with 2 different size/baos: can you post your config.xml? From the stacktrace I see the repository.store() method has been called by the RemoteDelivery, and looking at the message name I guess you have a gateway configured: am I right? Otherwise the mail names should end by " to <recipientdomainname>" Can you add a few debug lines to the MessageInputStream class (log the message name and the full stack trace in the "} catch (IOException e) {" block in the pipedstream handling Thread. (MessageInputStream:67) You may consider adding logs to the throwException() method (MessageInputStream:126). Have you identified a "problematic" message so that we can try reproducing this? Another test could be to add a debug mailet just before the RemoteDelivery. Something like the DumpSystemErr but saving the message to a file named like the mail.getName() (instead of System.err) so that it logs every mail it process.
        Hide
        norman Norman Maurer added a comment -

        Add this Patch to reflect the changes i made for debuging

        Show
        norman Norman Maurer added a comment - Add this Patch to reflect the changes i made for debuging
        Hide
        norman Norman Maurer added a comment -

        I post a patch to reflect the debug changes i made.
        Your right i use it as gateway. Also i will upload a file with one email i got problems with.

        Mybe you can tell me where i should but more debug linesi n ? or made a patch ?

        Show
        norman Norman Maurer added a comment - I post a patch to reflect the debug changes i made. Your right i use it as gateway. Also i will upload a file with one email i got problems with. Mybe you can tell me where i should but more debug linesi n ? or made a patch ?
        Hide
        norman Norman Maurer added a comment -

        Here a a mail with which i had problems

        Show
        norman Norman Maurer added a comment - Here a a mail with which i had problems
        Hide
        bago Stefano Bagnara added a comment -

        The baos log is not useful: it is a ByteArray so we can safely say we know its correct size.

        I this we should find how you have the same "mail.name" logged twice with different sizes.

        We know that RemoteDelivery with a configured gateway store the mail with no changes to the name in the ougoing spool. So the 2 logs could be related to the store in the main spool and the following store in the outgoing spool. What I still don't understand is why the size is totally different.

        Maybe you have a few mailets in between (from the root processor to the RemoteDelivery mailet) that completely change the mail content. Can you check this?

        You should also add the size logging to the setBinaryStream called in JDBCMailRepository:668. This code is called when the message is updated in the spool (every time it is moved to a different processor, for example).

        Show
        bago Stefano Bagnara added a comment - The baos log is not useful: it is a ByteArray so we can safely say we know its correct size. I this we should find how you have the same "mail.name" logged twice with different sizes. We know that RemoteDelivery with a configured gateway store the mail with no changes to the name in the ougoing spool. So the 2 logs could be related to the store in the main spool and the following store in the outgoing spool. What I still don't understand is why the size is totally different. Maybe you have a few mailets in between (from the root processor to the RemoteDelivery mailet) that completely change the mail content. Can you check this? You should also add the size logging to the setBinaryStream called in JDBCMailRepository:668. This code is called when the message is updated in the spool (every time it is moved to a different processor, for example).
        Hide
        norman Norman Maurer added a comment -

        The only chnages that are made by mailets are:
        1. Add some headers
        2. Add some attributes
        3. add a footer if possible.

        Show
        norman Norman Maurer added a comment - The only chnages that are made by mailets are: 1. Add some headers 2. Add some attributes 3. add a footer if possible.
        Hide
        bago Stefano Bagnara added a comment -

        Just applied a patch to set the default behaviour to the old one (use FULL in memory ByteArray instead of small streaming buffer).
        Adding a "<inMemorySizeLimit>4096</inMemorySizeLimit> " as a child of <repository><config> element for JDBCMail and JDBCSpool reenable streaming for messages larger than 4KB.

        I also applied a patch to the MimeMessage size calculator that could be the real cause of the issue (I have written this weeks ago and forgot to commit, so I always tested with this version, maybe this was the real fix).

        Norman, can you get the latest trunk, add an inMemorySizeLimit really small (1 byte) and tell me wether the exception is there or finally gone?

        Show
        bago Stefano Bagnara added a comment - Just applied a patch to set the default behaviour to the old one (use FULL in memory ByteArray instead of small streaming buffer). Adding a "<inMemorySizeLimit>4096</inMemorySizeLimit> " as a child of <repository><config> element for JDBCMail and JDBCSpool reenable streaming for messages larger than 4KB. I also applied a patch to the MimeMessage size calculator that could be the real cause of the issue (I have written this weeks ago and forgot to commit, so I always tested with this version, maybe this was the real fix). Norman, can you get the latest trunk, add an inMemorySizeLimit really small (1 byte) and tell me wether the exception is there or finally gone?
        Hide
        norman Norman Maurer added a comment -

        Just build james from svn and set it to 1 byte. Now we have to wait again.

        Show
        norman Norman Maurer added a comment - Just build james from svn and set it to 1 byte. Now we have to wait again.
        Hide
        bago Stefano Bagnara added a comment -

        Marking this as resolved because the current trunk should no more been affected by this bug.
        Btw we should link to this issue and open a new "Improvement" issue to find a solution to reenable the optimizations provided by the "commented" code.

        Show
        bago Stefano Bagnara added a comment - Marking this as resolved because the current trunk should no more been affected by this bug. Btw we should link to this issue and open a new "Improvement" issue to find a solution to reenable the optimizations provided by the "commented" code.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            norman Norman Maurer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development