I know this is a common problem, but i've tried all possible measures to get rid of this exception
here's what i tried * I downloaded javamail-1.4.3 from sun site, and copied mail.jar and activation.jar to my classpath java/jre6/lib/ext
* i noticed there's no SharedByteArrayInputStream in mail/util, so i modified my jar file by copying this missing class from javax/mail/util to com/sun/mail/util/, and added it to classpath again, but the error persists.
* i also imported archive(both .jar files) into my project, but no use.
First of all I would suggest that you should not change 3rd party jar files as its difficult to gauge the side effects of the change.
The class SharedByteArrayInputStream is part of the package javax.mail.util from javamail 1.4 There might be some other jar file in the classpath (like j2ee.jar, weblogic.jar) which is refering older javamail implementation and hence causing the exception. Try finding it. You can also try placing the mail.jar file at the top of order in the classpath