3 Replies Latest reply on Jan 19, 2006 3:27 PM by acoliver

    status of mailbox refactoring

    acoliver

      I'm really close to having the new mailbox stuff working. Its just been a little maddening working on the bleeding edge. So for now I'm giving up on keeping up with the 4.0 branch as it is making me loose my mind. Unfortunately this means that some releases may have patch builds in it until the final release. However for example the latest 4.0 has a version of the ejb3 annotations that apparently are not documented anywhere. I just don't have the patience to figure out what hibernate they are using and go build that hibernate and build its javadocs just to figure out how to construct @Id. However, we'll be making changes to the appserver to support stuff that we need (especially security stuff) so we'll need those patches. Mostly its the instability of the EJB3 and Hibernate stuff that is the problem (which to be fair is why it isn't "gold" yet). When it works as advertised its really great. However it is very difficult to actually deal with some of the realities of the state of the implementation in places (I'm sure I'll hear about this post but I've tried to say this in a few different ways and the message hasn't gotten across). Today someone read my post on ServiceBeans (http://linuxintegrators.com/acoliver/code/2006/01/16/x-0154.html) and suggested using the JBoss spring integration. I'm not against that if it solves the problem but I fail to see how it moves static stuff into static descriptors and dynamic/configurable stuff into XML. The current state of the service beans is too limiting (a 1-1-1 correllation between class and instance and injected dependency), but AFAICT the Spring stuff puts us back where we started (a big ball of XML) or we can enjoy the same problem with a different implementation.

      So for now:

      Mostly XMBeans
      targeting JB 4.0.3 SP1 + patches where needed
      Forget HEAD (JB5) and Branch_4_0 (too painful)

      -Andy

        • 1. Re: status of mailbox refactoring
          acoliver

           

          Andrew-Olivers-Computer-3:/tmp/shit/javax/persistence acoliver$ telnet localhost 25
          Trying ::1...
          Connected to localhost.
          Escape character is '^]'.
          220 localhost.localdomain SMTP Server (JBMAIL SMTP Server version 0.1) ready January 18, 2006 8:18:25 PM EST
          MAIL FROM: <me@here.com>
          RCPT TO: <andy@localhost>
          DATA
          
          Subject: This sucks
          From: <me@here.com>
          To: <andy@localhost>
          Date: Wed, 18 Jan 2006 13:36:59 -0800 (PST)
          
          This sucks
          
          .
          250 Sender <me@here.com> OK
          250 Recipient <andy@localhost> OK
          354 Ok Send data ending with <CRLF>.<CRLF>
          250 Message received
          quit
          221 localhost.localdomain closing connection
          Connection closed by foreign host.
          Andrew-Olivers-Computer-3:/tmp/shit/javax/persistence acoliver$ telnet localhost 110
          Trying ::1...
          Connected to localhost.
          Escape character is '^]'.
          +OK POP3 Server (JBMAIL POP3 Server version 0.2) ready <67.1137633514717@localhost.localdomain>
          user andy
          +OK
          pass testpwd
          +OK
          list
          +OK 1 messages (1 octets)
          1 1
          .
          retr 1
          +OK
          Received: from null (localhost 0:0:0:0:0:0:0:1%0) by localhost.localdomain/JBossMail 1.0M4-preX (0:0:0:0:0:0:0:1%0)
           with SMTP id 1137633508093490.5167635386325; Wed, 18 Jan 2006 20:18:28 -0500 (EST)
          Subject: This sucks
          From: <me@here.com>
          To: <andy@localhost>
          Date: Wed, 18 Jan 2006 13:36:59 -0800 (PST)
          
          This sucks
          
          .
          


          Eureka! Ignore the pessimistic proclimation. I finally got it! I'll probably commit it tomorrow after I go through and fix transaction handling (I know I have a hole in the mailstore's transaction being closed) and then do some build/installer updates.

          Parts of this are actually a little uglier than the old mailbox code because of the nasty unadvertised features of EJB3 (oddly now session/service beans are more painful than entity beans) so I had to revert some of my changes back to mbeans. Unfortunately, injecting the EJB3 persistence into an MBean requires some tin foil and duct tape. Fortunately, I've enough knowledge of those articles to get a job at the dept of homeland security!

          M4 will be tied to a single message store instance per JVM, but I expect to eliminate this in later revisions. Progress will now continue on a much more rapid pace.

          • 2. Re: status of mailbox refactoring
            acoliver

            todays commit has most of my changes but I need to go back and work on the build/installer. ATM I have only made the page store work. I'm working on the JDBC3 and Postgresql store ATM. Mostly un-ejbing them.

            • 3. Re: status of mailbox refactoring
              acoliver

              other issues:

              Delete is not done
              15:26:49,741 INFO [STDOUT] msg is org.jboss.mail.mailbox.MessageData@bb336f
              15:27:04,361 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: org.jboss.mail.mailbox.Folder.messages, no session or session was closed
              org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jboss.mail.mailbox.Folder.messages, no session or session was closed
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
              at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
              at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
              at org.hibernate.collection.PersistentBag.get(PersistentBag.java:398)
              at org.jboss.mail.mailbox.Folder.getMessageAt(Folder.java:118)
              at org.jboss.mail.pop3.handlers.CmdDELE.handleRequest(CmdDELE.java:53)
              at org.jboss.mail.pop3.POP3ProtocolInstance.handleRequest(POP3ProtocolInstance.java:201)
              at org.jboss.mail.ConnectionHandler.runSocket(ConnectionHandler.java:181)
              at org.jboss.mail.ConnectionHandler.run(ConnectionHandler.java:81)
              at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
              at java.lang.Thread.run(Thread.java:613)
              15:27:04,385 INFO [STDOUT] Exception in thread "Thread-21"
              15:27:04,386 INFO [STDOUT] org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jboss.mail.mailbox.Folder.messages, no session or session was closed
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
              at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
              at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
              at org.hibernate.collection.PersistentBag.get(PersistentBag.java:398)
              at org.jboss.mail.mailbox.Folder.getMessageAt(Folder.java:118)
              at org.jboss.mail.pop3.handlers.CmdDELE.handleRequest(CmdDELE.java:53)
              at org.jboss.mail.pop3.POP3ProtocolInstance.handleRequest(POP3ProtocolInstance.java:201)
              at org.jboss.mail.ConnectionHandler.runSocket(ConnectionHandler.java:181)
              at org.jboss.mail.ConnectionHandler.run(ConnectionHandler.java:81)
              at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
              at java.lang.Thread.run(Thread.java:613)