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?
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?