Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
vani hosagoudra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What tool did you use to development?
I think because they are conflicted that between tools lib and your abb lib.
 
balaji subbu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its seems like mail.jar is missing in classpath. mention the jar name path in MANIFEST.MF and check it again .
 
sun xiaoyong
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic