Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

javamail runs well in eclipse IDE but gets exception in JRE

Thread view: 
xukai04@gmail.com - 08 Sep 2006 20:09 GMT
Recently I am using Javamail in a project. It works great in myeclipse
IDE, but always get exception in the run time environment as a jar.
i.e., javamail behaves differently in IDE and system JRE.
for example,
   MimePart.getContent() returns String in IDE, but returns
SharedByteArrayInputstream in JRE.
similarly,
   new MimeMessage(session, inputstream) works fine for multipart in
IDE, but in JRE, I get the error:
   javax.mail.MessagingException: MIME part of type
"multipart/related; boundary="======ADSA134511"
contains object of type com.sun.mail.util.SharedByteArrayInputStream
instead of MimeMultipart

I guess it caused by different version of javamail/activation, but
seems they are loaded from the same jar
(I called the following code to check the path of jar:
       URL location =
Transport.class.getProtectionDomain().getCodeSource().getLocation();

logger.debug("Transport.class.getProtectionDomain().getCodeSource().getLocation():
" + location.toString());
)

Any idea about this problem.
Thanks a lot.
Lothar Kimmeringer - 09 Sep 2006 12:53 GMT
> I guess it caused by different version of javamail/activation, but
> seems they are loaded from the same jar
[quoted text clipped - 7 lines]
>
> Any idea about this problem.

Seems that Eclipse is setting the Content-Handler differently.
This can be done with the class CommandMap.

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.