5 Replies Latest reply on Jan 10, 2005 9:22 AM by Michael Barker

    (Patch) Heap protect and other fixes

    Michael Barker Apprentice


      I have made some changes to jboss-mail. I have attach a zip file containing the patch and a CHANGELOG to the patches wiki page:


      The changelog:

      - Use variable to locate JBOSS within classpath setting for eclipse project

      - Added heap protection to smtp CmdDATA. Requires additional property of threshold to be added to the protocol. Default is 5000000 bytes. Passes the mimimum of the heap available and max message size to the SizeLimitedInputStream. Throws a MessageSizeException if it is exceeded and will return a 552 error to the client. MessageSizeException had to be threaded through a number of the Mail construction methods.

      - White space changes. Modified Mail.java, MailHeadersImpl.java, CmdDATA.java updated to JBoss code style as per:

      - Fix for message body being read in as a header, now is read properly into the body of the Mail object. See:

      - Handle large messages more effiecently. Previously when loading the body of the message the input is read into a list of arrays then copied into one large array. I have changed this to leave the body as a list of arrays and only copy the data from the body when required. When creating the message only slightly more memory than the length of the message is required during processing. I.e. to handle a 4MB message about 4.1MB is needed. Previously about 25MB was required to handle the same size messsage.

      - 2 JUnits tests have been added, one to test that 552 is return if message is too large (TestCMDData). Other to test that the body is stored correctly within the message (TestMail).

        • 1. 4.0.0 Release tasks
          Michael Barker Apprentice

          This is a dynamic list of the issues to complete for the 4.0.0 release. I will merge any new posts to this one and update the status as needed.

          Migrate ant 1.6.x testuite changes for finer grained control over the jboss server configuration under test from 3.2. Assigned to Scott. Status: in progress.

          Implement JMS inbound resource adapter. Assigned to Adrian. Status: COMPLETE - But experimental

          Need to port HAJMS changes from 3.2 to 4.0. Assigned to Ovideuo and Adrian. Status: COMPLETE

          [ 840536 ] Oracle 9iR2: same table in diff. schema Assigned to Alexey, Status: COMPLETE

          [ 969699 ] Invalid SQL to load relationships when tables uses db schema Assigned to Alexey, Status: COMPLETE

          Add database schema support for CMP mappings. Assigned to Alexey, Status: COMPLETE

          Port -b, --host default interface binding from 3.2. Assigned to Scott, Status: COMPLETE

          Failing unit tests
          Assigned to Scott, Status: In progress

          • 2. Re: (Patch) Heap protect and other fixes
            Andrew Oliver Master

            Excellent and thank you! It will be applied after M2 is released.

            • 3. Re: (Patch) Heap protect and other fixes
              Andrew Oliver Master

              After applying this patch I get:

              07:20:03,472 INFO [JMSMailListener] PUT MESSAGE ON QUEUE:org.jboss.mail.message.Mail@ffb8d1
              07:20:03,559 INFO [STDOUT] javax.jms.MessageFormatException: Object cannot be serialized
              07:20:03,562 INFO [STDOUT] at org.jboss.mq.SpyObjectMessage.setObject(SpyObjectMessage.java:83)
              07:20:03,563 INFO [STDOUT] at org.jboss.mq.SpySession.createObjectMessage(SpySession.java:306)
              07:20:03,571 INFO [STDOUT] at org.jboss.mail.maillistener.JMSMailListener.putMessageOnQueue(JMSMailListener.java:285)
              07:20:03,572 INFO [STDOUT] at org.jboss.mail.maillistener.JMSMailListener.sendMessageQueue(JMSMailListener.java:267)
              07:20:03,573 INFO [STDOUT] at org.jboss.mail.maillistener.JMSMailListener.send(JMSMailListener.java:242)
              07:20:03,574 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              07:20:03,575 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              07:20:03,576 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              07:20:03,577 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
              07:20:03,578 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
              07:20:03,582 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
              07:20:03,583 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
              07:20:03,585 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
              07:20:03,585 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
              07:20:03,586 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
              07:20:03,587 INFO [STDOUT] at org.jboss.mail.maillistener.JMXMailListenerProxy.send(JMXMailListenerProxy.java:50)
              07:20:03,589 INFO [STDOUT] at org.jboss.mail.smtp.handlers.CmdDATA.handleRequest(CmdDATA.java:130)
              07:20:03,590 INFO [STDOUT] at org.jboss.mail.smtp.handlers.RequireSTARTTLSProxy.handleRequest(RequireSTARTTLSProxy.java:48)
              07:20:03,591 INFO [STDOUT] at org.jboss.mail.smtp.SMTPProtocolInstance.handleRequest(SMTPProtocolInstance.java:126)
              07:20:03,592 INFO [STDOUT] at org.jboss.mail.ConnectionHandler.runSocket(ConnectionHandler.java:165)
              07:20:03,594 INFO [STDOUT] at org.jboss.mail.ConnectionHandler.run(ConnectionHandler.java:71)
              07:20:03,595 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
              07:20:03,596 INFO [STDOUT] at java.lang.Thread.run(Thread.java:552)
              07:20:03,598 INFO [STDOUT] RuntimeMBeanException: java.lang.RuntimeException: javax.jms.MessageFormatException: Object cannot be serialized

              Please attempt to reproduce and fix. Please avoid reformatting and code changes in the same patch (it makes it hard to verify what was changed).



              • 4. Re: (Patch) Heap protect and other fixes
                Michael Barker Apprentice

                Ok, I know what the problem is (missing serializable inteface).

                I will fix this weekend a resubmit as a set of individual patches.


                • 5. Re: (Patch) Heap protect and other fixes
                  Michael Barker Apprentice


                  I have resubmitted this patch (misc-fixes-20050108-2.zip). I have removed the heap protection and the white space fixes (will submit these seperately). I have added a JUnit to check that the Mail object can be serialized (can't seem to get the JMS Unit tests to work).

                  I have broken each change into seperate patch files and included in the zip a README file containing a description of each.


                  P.S. Anyone know why the topics are getting corrupted and posts keep disappearing?