james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: James under Merlin
Date Fri, 16 Aug 2002 07:43:20 GMT


Noel J. Bergman wrote:

>Steve,
>
>You're probably seeing the FAQ item.  Are you running the CVS HEAD?  
>

Yep.

>It
>should happen far less frequently with changes made recently to the code.
>Basically, an exception occurs because of a known race condition.  A thread
>picks up a mail item from the spool.  After it gets the item, it attempts to
>lock the item.  If another thread has it locked, then the second thread will
>give up and go back for another item.  However, there is a window where one
>thread can pickup an item from the spool, and between when it gets the spool
>item and when it attempts to lock it, the thread that actually owns the
>spool item removes it from the spool and unlocks it.  So the second thread
>finds that it is able to lock it, but when it goes to get it, the item is
>gone.
>
>The code:
>
>                String key = spool.accept();
>                MailImpl mail = spool.retrieve(key);
>                if (infoEnabled) {
>
>should be changed to:
>
>                String key = spool.accept();
>                MailImpl mail = spool.retrieve(key);
>                if (mail == null) continue;
>                if (infoEnabled) {
>
>since we know that spool.retrieve(key) can return null.  Try patching your
>copy of the code, and see if that doesn't fix it.
>

Thanks!
Patched the code locally and the NPE dissapears.
However, the mailstore exception remains - here is an extract of the 
trace together with some additional comments in-line:

  [INFO   ] (root.james.smtp-server): Hello Name is: home
  [DEBUG  ] (root.james.smtp-server): Max message size is: 0
  [INFO   ] (root.james.smtp-server): Connection from racine.noos.net 
(212.198.2.71)
  [DEBUG  ] (root.james.smtp-server): Sent: 220 home SMTP Server (JAMES 
SMTP Server 2.1a1-cvs) ready Fri, 16 Aug 2002 09:34:06 +0200 (CEST)
  [DEBUG  ] (root.james.smtp-server): Command received: EHLO smtp.noos.fr
  [DEBUG  ] (root.james.smtp-server): Sent: 250 home Hello smtp.noos.fr 
(racine.noos.net [212.198.2.71])
  [DEBUG  ] (root.james.smtp-server): Command received: MAIL 
FROM:<mcconnell@apache.org>
  [DEBUG  ] (root.james.smtp-server): Sent: 250 Sender 
<mcconnell@apache.org> OK
  [DEBUG  ] (root.james.smtp-server): Command received: RCPT 
TO:<mcconnell@home.osm.net>
  [DEBUG  ] (root.james.smtp-server): Sent: 250 Recipient 
<mcconnell@home.osm.net> OK
  [DEBUG  ] (root.james.smtp-server): Command received: DATA
  [DEBUG  ] (root.james.smtp-server): Sent: 354 Ok Send data ending with 
<CRLF>.<CRLF>
Retrieving from: C:\TEMP\Mail1029483246359-056372.m64
Saving to:       file://var/mail/spool//Mail1029483246359-0
Modified: false
  [DEBUG  ] (root.james.mailstore): Mail Mail1029483246359-0 stored.
  [INFO   ] (root.james.james): Mail Mail1029483246359-0 pushed in spool
  [INFO   ] (root.james.smtp-server): Mail sent to Mail Server
  [DEBUG  ] (root.james.smtp-server): Sent: 250 Message received
  [DEBUG  ] (root.james.smtp-server): Command received: QUIT
  [DEBUG  ] (root.james.smtp-server): Sent: 221 home Service closing 
transmission channel
  [DEBUG  ] (root.james.smtp-server): Closing socket.
  [DEBUG  ] (root.james.mailstore): Retrieving mail: Mail1029483246359-0

The following error is occuring inside the 
File_Persistent_Object_Repository class, get( String key ) method.  I'm 
using the cornerstone version from the Avalon Excalibur CVS, but I 
noticed that there is a excalibur-datasource-1.0.jar in the James lib 
directory which contains classes that also exist in cornerstone.jar. 
 The setup I have is ignoring the excalibur-datasource-1.0.jar - is this 
likely to be a problem?

Steve.


  [ERROR  ] (root.james.mailstore): Exception retrieving mail: 
java.lang.RuntimeException: Exception caught while retrieving an object, 
cause:
 java.io.StreamCorruptedException: unexpected end of block data, so 
we're deleting it... good riddance!
java.lang.RuntimeException: Exception caught while retrieving an object, 
cause: java.io.StreamCorruptedException: unexpected end of block da
ta
        at 
org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Object_Repository.get(File_Persistent_Object_Repository.java:68)

        at 
org.apache.james.mailrepository.AvalonMailRepository.retrieve(AvalonMailRepository.java:260)
        at 
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:268)
        at 
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:47)
        at 
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:80)





>
>	--- Noel
>
>-----Original Message-----
>From: Stephen McConnell [mailto:mcconnell@apache.org]
>Sent: Friday, August 16, 2002 2:15
>To: James Developers List
>Subject: Re: James under Merlin
>
>
>
>
>In JamesSpoolManager, run method:
>
>                MailImpl mail = spool.retrieve(key);
>
>The mail variable is is the source of the NPE.
>
>Steve.
>
>
>Stephen McConnell wrote:
>
>
>>
>>Paul Hammant wrote:
>>
>>
>>>Stephen,
>>>
>>>
>>>>I've been playing around with James under Merlin.
>>>>
>>>>During the process I came accross a runtime problem:
>>>>
>>>> 1. The class AvalonUsersStore is referenced as a Component
>>>>    somewhere or other but doesn't implement the Component
>>>>    interface
>>>>
>>>
>>>
>>>Err should be able to fix that one.
>>>
>>
>>
>>It rather easy!
>>
>>
>>>
>>>> 2. After starting James inside Merlin, then sending an email
>>>>    to an arbitary name on the server James is running on,
>>>>    I get NPE - which is where I figure I may need some help
>>>>    from you guys ...
>>>>
>>>
>>>
>>>This is where we wich we could unit test each comp.
>>>
>>
>>
>>Something to keep in mind is that I'm using the CVS version of
>>cornerstone components.  I had to do a number of updates to
>>cornerstone including
>>
>> (a) addition of the Component interface to soem of the blocks
>>     becuase they are used in James - so adding Component is
>>     basically a backward compatibility thing
>>
>> (b) addition of some meta-info into a couple of the blocks so
>>     that Merlin can automatically build the services without
>>     having Phoenix around
>>
>>Apart from the above, the only differences are that I'm using a few
>>more excalibur jar files that are not included in the James lib
>>(because they are included in Phoenix and not in Merlin) and
>>naturally, this bypasses all of the Phoenix config, assembly, and
>>server files.
>>
>>
>>>A guy at BP has written a generic AbstractPhoenixTestCase (where
>>>Phoenix is mocked).  I'll get him to write it up and someone might do
>>>the same thing inside Phoenix CVS or maybe Merlin CVS ? :-)
>>>
>>
>>
>>I'll put in place a Merlin projects directory containing the James
>>content and update the CVS.
>>
>>
>>>Failing that we'll have to do good old fashioned debugging.  Question
>>>do you use IntelliJ ?  Have you got interactive debuging working with
>>>Phoenix?
>>>
>>
>>
>>No on both points!
>>In the meantime I'll start tracking it down.
>>
>>Cheers, Steve.
>>
>>
>>
>>>
>>>- Paul
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><mailto:james-dev-unsubscribe@jakarta.apache.org>
>>>For additional commands, e-mail:
>>><mailto:james-dev-help@jakarta.apache.org>
>>>
>
>--
>
>Stephen J. McConnell
>
>OSM SARL
>digital products for a global economy
>mailto:mcconnell@osm.net
>http://www.osm.net
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>
>

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message