This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Websphere and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Sha redByteArrayInputSt" Watch "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Sha redByteArrayInputSt" New topic
Author

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Sha redByteArrayInputSt

vani hosagoudra
Greenhorn

Joined: Sep 06, 2012
Posts: 1

i am getting the below error message when i run my sendmail java file.i have updated my classpath with mail.jar and activation.jar.and using jdk 6.so please help what else needs to be done to run my java successfully.
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Sha
redByteArrayInputStream
at SendMail.main(SendMail.java:22)
Caused by: java.lang.ClassNotFoundException: com.sun.mail.util.SharedByteArrayIn
putStream
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more

sun xiaoyong
Greenhorn

Joined: Sep 08, 2011
Posts: 8
What tool did you use to development?
I think because they are conflicted that between tools lib and your abb lib.
balaji subbu
Greenhorn

Joined: Nov 14, 2011
Posts: 11
its seems like mail.jar is missing in classpath. mention the jar name path in MANIFEST.MF and check it again .
sun xiaoyong
Greenhorn

Joined: Sep 08, 2011
Posts: 8
balaji subbu wrote:its seems like mail.jar is missing in classpath. mention the jar name path in MANIFEST.MF and check it again .


He had updated classpath with mail.jar and activation.jar. so I'm afraid I don't agree with you. It's must be the libs conflicted.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

If you're using Java 6 then you don't need the activation.jar file in your classpath, those classes are now in the standard API.

I don't know if this is contributing to the class-loading conflicts which sun xiaoyong refers to, but I suppose it's possible. It's quite easy to get those conflicts when you're using things like JavaMail in your Websphere web application.

 
Have you checked out Aspose?
 
subject: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Sha redByteArrayInputSt
 
jQuery in Action, 3rd edition