We have some discrepancy in Java Mail between staging and Production Environment. We are using spring-context-support-3.2.0.RELEASE.jar
We are triggering email web services (java springMail Web services) and we were able to send emails successfully without CC address in Staging Environment.
While in Production we are getting this following error if we try to send an Email without CC Address. [Note : SAME WAR FILE WORKS PERFECTLY IN FIT]
Production Logs:
<Dec 11, 2015 8:16:19 PM EST> <Error> <HTTP> <BEA-101017> <[ServletContext@504819268[app:sfsows module:sfsows.war path:/sfsows spec-version:2.5]] Root cause of ServletException.
org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is java.lang.NullPointerException
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:367)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at com.sfso.ipad.service.impl.SendEmailServiceImpl.sendEmail(SendEmailServiceImpl.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NullPointerException
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:609)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:569)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:546)
at org.springframework.mail.javamail.MimeMessageHelper.parseAddress(MimeMessageHelper.java:706)
at org.springframework.mail.javamail.MimeMessageHelper.setCc(MimeMessageHelper.java:637)
Truncated. see log file for complete stacktrace