Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JavaMail Problem with JRE 6.0 using JNI

843830May 20 2007 — edited Apr 7 2008
Hi,

I am currently experiencing problems with JavaMail under JRE 6.0. It is a little odd in that it works fine when run as standalone app, but when called through JNI it throws the following exception:
java.lang.ClassCastException: javax.mail.util.SharedByteArrayInputStream cannot be cast to javax.mail.Multipart
when executing the following line of code:
Multipart parts = (Multipart) mimeMessage.getContent();
I've checked the mailcap file contains the content-handler and that the mail.jar is on the classpath.

This same code works fine under versions 1.4.2 and 5.0 of the JRE.

Any help appreciated!

Regards,
Matt
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2008
Added on May 20 2007
35 comments
1,874 views