You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by HockeyDave <da...@yahoo.com> on 2008/10/19 18:37:08 UTC

Certain email MimeMultipart barf

message.ContentType is
multipart/mixed;
boundary=--boundary_1916_dae063ae-ff1f-4a7d-8a1d-4b998f7d5941

Camel 1.4 seems to barf on trying to process these email messages types.
Attempt to getCount() results in exception.

MimeMultipart multi = message.getBody(MimeMultipart.class);
		if (multi != null) {
			for (int i = 0; i < multi.getCount(); i++) {


javax.mail.MessagingException: No inputstream from datasource
	at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:646)
	at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
	at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:229)
	at com.contextweb.mail.MailReader.process(MailReader.java:79)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:91)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
	at
org.apache.camel.component.mail.MailConsumer.processMessage(MailConsumer.java:169)
	at
org.apache.camel.component.mail.MailConsumer.processMessages(MailConsumer.java:151)
	at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:105)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

Same if you try this:
Map<String, DataHandler> attachments = message.getAttachments();

Caused by: javax.mail.MessagingException: No inputstream from datasource
	at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:646)
	at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
	at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:229)
	at
org.apache.camel.component.mail.MailMessage.extractAttachments(MailMessage.java:160)
	at
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:132)
	... 28 more

-- 
View this message in context: http://www.nabble.com/Certain-email-MimeMultipart-barf-tp20057881s22882p20057881.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Certain email MimeMultipart barf

Posted by HockeyDave <da...@yahoo.com>.
Hi Claus,

 Thanks for the response and apologies for my delay in responding. 
Unfortunately I now don't recall where that problem email came from, but as
soon as I see it again, I'll respond.  I had thought that the mimetype would
be sufficient.  I'll make sure that I collect more information the next
time.

Thanks,
dave
-- 
View this message in context: http://www.nabble.com/Certain-email-MimeMultipart-barf-tp20057881s22882p20120689.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Certain email MimeMultipart barf

Posted by HockeyDave <da...@yahoo.com>.
Hi Claus,

 Wow, coincidentally I just ran into this again and it's kind of strange but
sort of makes sense too (theoretically).  I was trying to use
processOnlyUnseenMessage=true and noticed that I keep getting the same email
over and over again in my mail bean.  So I left my program stopped in the
eclipse debugger within the process method and went into the forum to post a
question with respect to this. While in there, I took the time to send a
response on this thead.  All of this took somewhere around 5-15 minutes with
people stopping by my desk... 

  Anyways, when I got back to my eclipse debugger (stopped in the process
method of my mail bean) and hit continue I got this error!  Keep in mind
that this is the same email that I just processed 7 times before
successfully. So... I think that something in camel timed out my process
method, freed up the inputstream (or some other resources) and then when I
hit continue, I get the errror because the resource is freed up.  Makes kind
of sense since it isn't likely that this mail message is suddenly bad after
processing it succesfully.

  It is highly likely that this is the same scenario (i.e. debugging) that I
ran into on Sunday when I first saw this.  I hope this helps.

Best,
Dave
-- 
View this message in context: http://www.nabble.com/Certain-email-MimeMultipart-barf-tp20057881s22882p20120975.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Certain email MimeMultipart barf

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

What kind of multipart data is in your emails?

Can you try adding a debugger? It's kinda strange that the mail returns the exception: No inputstream from datasource



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: HockeyDave [mailto:david_peterson4146@yahoo.com] 
Sent: 19. oktober 2008 18:37
To: camel-user@activemq.apache.org
Subject: Certain email MimeMultipart barf


message.ContentType is
multipart/mixed;
boundary=--boundary_1916_dae063ae-ff1f-4a7d-8a1d-4b998f7d5941

Camel 1.4 seems to barf on trying to process these email messages types.
Attempt to getCount() results in exception.

MimeMultipart multi = message.getBody(MimeMultipart.class);
		if (multi != null) {
			for (int i = 0; i < multi.getCount(); i++) {


javax.mail.MessagingException: No inputstream from datasource
	at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:646)
	at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
	at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:229)
	at com.contextweb.mail.MailReader.process(MailReader.java:79)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:91)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
	at
org.apache.camel.component.mail.MailConsumer.processMessage(MailConsumer.java:169)
	at
org.apache.camel.component.mail.MailConsumer.processMessages(MailConsumer.java:151)
	at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:105)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

Same if you try this:
Map<String, DataHandler> attachments = message.getAttachments();

Caused by: javax.mail.MessagingException: No inputstream from datasource
	at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:646)
	at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
	at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:229)
	at
org.apache.camel.component.mail.MailMessage.extractAttachments(MailMessage.java:160)
	at
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:132)
	... 28 more

-- 
View this message in context: http://www.nabble.com/Certain-email-MimeMultipart-barf-tp20057881s22882p20057881.html
Sent from the Camel - Users mailing list archive at Nabble.com.