This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes Java Mail Problem Help!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Java Mail Problem Help!!" Watch "Java Mail Problem Help!!" New topic
Author

Java Mail Problem Help!!

Stephen Batsas
Ranch Hand

Joined: Jan 22, 2002
Posts: 117
Dear Ranchers

Can anyone help me with this problem:

I have created a servlet using javamail api. When I test the servlet I get a null pointer exception thrown by the InternetAddress class. See the source code comment //******. The mail is sent and received succesfully by the recipient although a null pointer is thrown. The stack trace states the problem occurs at line 569 of InternetAddress.java. I dont have the source code.

I have disguised the problem behind a friendly error page that refreshes and redirects back to the home page.

Source code as follows:


Regards
Stephen Batsas
SCPJ
SCWCD

[ Jess added UBB [code] tags to perserve whitespace ]
[ September 02, 2004: Message edited by: Jessica Sant ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Must be a null returned here. As part of the InternetAddress(String address) constructor the address is parse to check validity - if there's no address then the parsing will complain.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Stephen Batsas
Ranch Hand

Joined: Jan 22, 2002
Posts: 117
Thanx for prompt reply.

Regards
Stephen Batsas
SCPJ
SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Mail Problem Help!!
 
Similar Threads
sending email is not working in jdk1.3
Help me to run my first JavaMail app
Email with jsp
Email in jsp
Getting exception in sending Email from Servlet