james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Herrmann <herrmann_fr...@yahoo.com>
Subject strange exception
Date Mon, 23 Jun 2003 18:35:58 GMT
Hello!

While testing my custom mailet under high load
(approx. 5 messages per second) I get this Exception
from James:

java.lang.RuntimeException: Exception caught while
retrieving a stream : java.io.FileNotFoundException:
/james/develop/dist/james-2.1.2/apps/james/var/mail/spool/4D61696C313035363339323532353534392D37.Repository.FileStreamStore
(No such file or directory)
        at
org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository.get(File_Persistent_Stream_Repository.java:71)
        at
org.apache.james.mailrepository.MimeMessageAvalonSource.getInputStream(MimeMessageAvalonSource.java:59)
        at
org.apache.james.core.MimeMessageWrapper.writeTo(MimeMessageWrapper.java:198)
        at
org.apache.james.core.MailImpl.writeMessageTo(MailImpl.java:376)
        at
org.apache.james.mailrepository.AvalonMailRepository.store(AvalonMailRepository.java:274)
        at
org.apache.james.James.sendMail(James.java:444)
        at
org.apache.james.James.sendMail(James.java:407)
        at
org.apache.james.James.sendMail(James.java:389)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invoke(BlockInvocationHandler.java:92)
        at $Proxy9.sendMail(Unknown Source)
        at
MailService.forwardMail(MailService.java:317)
        at
ForwardMailet.service(ForwardMailet.java:146)
        at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:362)
        at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:385)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:315)
        at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:47)
        at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:80)

Basically method sendMail does remove all recipients
and adds a new one. Here is the code:

   public void forwardMail(String mailSender,String
mailRecipient) throws MessagingException {

        Collection recipients = mail.getRecipients();
        Collection recipientsToRemove = null;

        /* remove all recipients */
        for (Iterator i = recipients.iterator();
i.hasNext(); ) {
            MailAddress addr = (MailAddress)i.next();
            if (recipientsToRemove == null) {
                recipientsToRemove = new Vector();
            }
            recipientsToRemove.add(addr);
        }

        recipients.removeAll(recipientsToRemove);

        Collection recipientsToAdd = new HashSet();
        recipientsToAdd.add(new MailAddress(new
UtilAddress(mailRecipient).markMail()));

        myMailetContext.sendMail(mail.getSender(),
recipientsToAdd, mail.getMessage());

        /* set state to further processing */
        logger.info("mail state forwarded and orginal
set to GHOST");
        mail.setState(Mail.GHOST);
        return;

    }

I am using James 2.1.2 and the logs show no additional
information than the exception I mentioned. 

If I limit the load (eg one mail / second) the
exception does not occur.

Any ideas ?

Greets,
Frank Herrmann


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Mime
View raw message