dcsimg
when i am trying to send a mail by using java mail api iam getting "NullPointerException". How to rectify that problem??
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   anu_rag
Posted On:   Thursday, January 31, 2002 08:46 PM

Actually i have implemented the logic(to send the mail by using java mail api) in a servlet.I am getting the NullPointerException. Any one can help me. Its very urgent. the exception is as follows: ----------------------------- java.lang.NullPointerException at javax.mail.internet.MimeUtility.checkAscii(MimeUtility.java:915) at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:812) at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1333) at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1321) at mailexample.MailExample.doPost(MailExample.java:52) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)    More>>

Actually i have implemented the logic(to send the mail by using java mail api) in a servlet.I am getting the NullPointerException. Any one can help me. Its very urgent.

			
the exception is as follows:
-----------------------------

java.lang.NullPointerException

at javax.mail.internet.MimeUtility.checkAscii(MimeUtility.java:915)

at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:812)

at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1333)

at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1321)

at mailexample.MailExample.doPost(MailExample.java:52)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:484)

---------------------------------------

   <<Less

Re: when i am trying to send a mail by using java mail api iam getting "NullPointerException". How to rectify that problem??

Posted By:   Manish_Dhupar  
Posted On:   Thursday, January 31, 2002 10:20 PM

Hi anurag..
Ia m sure that U know the origin of the null pointer exception. Trace the object that is giving the NPE. U are calling some method of that class and the object is null, after tracing the object put a check for the null value and if there is a possibility of a null value for that object try not to call the method on the object.........

Regards,
Manish
About | Sitemap | Contact