You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Arnaud Vandyck (JIRA)" <ji...@apache.org> on 2016/09/27 12:50:20 UTC
[jira] [Commented] (KARAF-4154) javax.mail.Message.getContent()
returns IMAPInputStream
[ https://issues.apache.org/jira/browse/KARAF-4154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526019#comment-15526019 ]
Arnaud Vandyck commented on KARAF-4154:
---------------------------------------
Isn't that question related to your problem: http://stackoverflow.com/questions/10302564/can-not-cast-imapinputstream-to-multipart
See:
{quote}
This usually happens because JAF can't find the configuration file that maps MIME types to classes. The most common reason for that failure is that the environment you're running in isn't setting the thread's context class loader correctly. See this JavaMail forum thread for a workaround.
The second most common reason for this failure is that you repackaged the classes in the mail.jar file into your own jar file, but forgot to include the configuration files in the META-INF directory.
{quote}
And the link to the forum: https://community.oracle.com/thread/2371993?tstart=0
Hope it helps,
> javax.mail.Message.getContent() returns IMAPInputStream
> -------------------------------------------------------
>
> Key: KARAF-4154
> URL: https://issues.apache.org/jira/browse/KARAF-4154
> Project: Karaf
> Issue Type: Bug
> Affects Versions: 2.4.2
> Environment: Linux Mint 17.2 Cinnamon
> Oracle JDK 1.7
> Reporter: Anton Johansson
> Priority: Critical
> Labels: javax.mail, mail
>
> I'm using JavaMail API to read emails from Gmail IMAP. The emails are of type multipart. I open up a Store, then I open up a Folder ("INBOX"), then I get the messages from that folder.
> Outside of Karaf, when doing message.getContent() I get a javax.mail.internet.MimeMultipart object back. Doesn't matter if I use version 1.4.5 (the one that Karaf provides) or 1.5.4 (the latest).
> Inside Karaf, I get an IMAPInputStream back, which isn't ideal. I'd very much like to get the MimeMultipart object back. I've tried not adding any JavaMail libraries to Karaf, and relying on the one that Karaf itself provides (which is 1.4.5, according to the version matrix:
> http://karaf.apache.org/index/documentation/karaf-dependencies/karaf-deps-2.4.x.html
> I've also tried adding both javax.mail/javax.mail-api/1.5.4 and com.sun.mail/javax.mail/1.5.4 to Karaf, but the same problem occurs. I guess it still chooses the JAR's that Karaf provides.
> Even in the latest version of Karaf, 1.4.5 is used, so I'd guess the same problem exists there, but I cannot say for sure, I haven't tested.
> Am I missing something, or is there some workaround for this?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)