Calling a javamail class in a Servlet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, January 16, 2003 11:23 AM

HI Iam trying to call a class which will send an email (using javamail API) in a subclass of HttpServlet class. The Servlet class is SendEmail and Class sending email is MailClass. Iam creating an object of mail class in the SendEmail and calling a method of that object to send mail. But while executing this iam getting an exception like Error: 500 Internal Servlet Error: java.lang.NoClassDefFoundError: MailClass at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) at com.sun.web.core.ServletWrapper.loadServlet(ServletWrapper.java:100) at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:11   More>>

HI

Iam trying to call a class which will send an email (using javamail API) in a subclass of HttpServlet class.

The Servlet class is SendEmail and Class sending email is MailClass.
Iam creating an object of mail class in the SendEmail and calling a method of that object to send mail.

But while executing this iam getting an exception
like

Error: 500
Internal Servlet Error:

java.lang.NoClassDefFoundError: MailClass
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.web.core.ServletWrapper.loadServlet(ServletWrapper.java:100)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:119)
at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:168)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
at com.sun.web.core.Context.handleRequest(Context.java:414)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)


Can some explain me the reason.

Thanks in advance

   <<Less

Re: Calling a javamail class in a Servlet

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, January 17, 2003 07:03 AM

java.lang.NoClassDefFoundError: MailClass


Can some explain me the reason



It can't find your copy of the "mail.jar" file.


Tomcat, for instance, comes with it in "common/lib".

About | Sitemap | Contact