Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

JavaMail doesn't work in Web project

 
Abhi jitSingh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
If I create a simple Java Project (new -> Java Project) and try sending an email using JAVAMAIL (mail.jar and activation.jar) through a class with a main(), it works fine - EXPECTED.

But If I create a WEB Project and do the same (with same code and jars), I get
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
at javax.mail.Session.loadProvidersFromStream(Session.java:928) - NOT EXPECTED

However, If I deploy the WEB project on a server and run, the same setup works fine again - EXPECTED.

Please tell me why the NOT EXPECTED case happens?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread where you got an answer already.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!