aspose file tools*
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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java Mail Problem Help!!