JavaMail Problem with JRE 6.0 using JNI

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

[679 byte] By [Devoa] at [2007-11-27 4:45:41]
# 1
Please post your question on the JavaMail forum: http://forum.java.sun.com/forum.jspa?forumID=43
gymma at 2007-7-12 9:58:06 > top of Java-index,Desktop,Runtime Environment...