Hi Tim-Christian,

I stopped james 2 days ago for small config change (btw hot-config would be great :)) and I received exactly the same exception (I already saw it once or twice).
The exception was shown only when fetching mails on one specific account.

I deployed a fresh version of james trunk, and by magic, the error had disappeared .

I will report if I still encounter the exception.

Tks,

Eric


On 04/23/2010 04:33 PM, Norman Maurer wrote:
As a quick workaround , you should just remove the *Streaming* stuff
from the persistence.xml file. It seems like the classloader gets
confused otherwise sometimes...

Thx for Reporting,
Norman

2010/4/23, Tim-Christian Mundt (JIRA)<server-dev@james.apache.org>:
JPAStreamingMessage vs JPAMessage
---------------------------------

                  Key: IMAP-133
                  URL: https://issues.apache.org/jira/browse/IMAP-133
              Project: JAMES Imap
           Issue Type: Bug
           Components: JPA Mailbox
             Reporter: Tim-Christian Mundt
             Priority: Blocker


With newest James I quite often (as always not always) get this error during
copy operations which causes them to fail:

Exception in thread "pool-8-thread-1" java.lang.ClassCastException:
org.apache.james.imap.jpa.mail.model.openjpa.JPAStreamingMessage cannot
be cast to org.apache.james.imap.jpa.mail.model.JPAMessage
         at
org.apache.james.imap.jpa.mail.model.JPAMailboxMembership.<init>(JPAMailboxMembership.java:64)
         at
org.apache.james.imap.jpa.JPAMailbox.copyMessage(JPAMailbox.java:99)
         at
org.apache.james.imap.jpa.openjpa.OpenJPAMailbox.copyMessage(OpenJPAMailbox.java:83)
         at
org.apache.james.imap.store.StoreMailbox$5.run(StoreMailbox.java:611)
         at
org.apache.james.imap.store.transaction.AbstractTransactionalMapper.execute(AbstractTransactionalMapper.java:38)
         at
org.apache.james.imap.store.StoreMailbox.copy(StoreMailbox.java:603)
         at
org.apache.james.imap.store.StoreMailbox.copyTo(StoreMailbox.java:637)
         at
org.apache.james.imap.store.StoreMailboxManager.copyMessages(StoreMailboxManager.java:296)
         at
org.apache.james.imap.processor.CopyProcessor.doProcess(CopyProcessor.java:82)
         at
org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:125)
         at
org.apache.james.imap.processor.AbstractMailboxProcessor.process(AbstractMailboxProcessor.java:80)
         at
org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:73)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:44)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
         at
org.apache.james.imap.main.AbstractImapRequestHandler.doProcessRequest(AbstractImapRequestHandler.java:65)
         at
org.apache.james.imap.main.ImapRequestStreamHandler.handleRequest(ImapRequestStreamHandler.java:82)
         at
org.apache.james.imapserver.netty.ImapStreamChannelUpstreamHandler.processStreamIo(ImapStreamChannelUpstreamHandler.java:64)
         at
org.jboss.netty.handler.stream.StreamHandler$1.run(StreamHandler.java:127)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
         at java.lang.Thread.run(Unknown Source)

streaming is set to false. I found the place where the JPAStreamingMessage
is created:

633 final MessageMapper<Id>  mapper = createMessageMapper(session);
634
635 final List<MailboxMembership<Id>>  originalRows =
mapper.findInMailbox(set);

in org.apache.james.imap.store.StoreMailbox. Those "originalRows" contain
the JPAStreamingMessage(s). The question here is: How does the mapper know,
which kind of Message to create - JPAStreamingMessage or JPAMessage? By the
way, the former is defined twice in persistence.xml. First I thought, this
might be the cause for the error, but really sometimes it gets the one type
and after restarting James it maybe gets the other (but always the same type
during one run).

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


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



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

Reply via email to