|
|
|
Okay, I tried it out (with tag 2.0.1 from svn).
The problem was inside the web-test, as it tries to send to 'signup-user@raibledesigns.com', while mail-server denies to relay to foreign domains for my development (and any other unknown) host. This initial cause triggered the NullPointerException in MailEngine to show up, as ex.getCause() is null in this case. Here's the relevant part of the stacktrace: [INFO] [talledLocalContainer] org.springframework.mail.MailSendException; nested exception details (1) are: [INFO] [talledLocalContainer] Failed message 1: [INFO] [talledLocalContainer] javax.mail.SendFailedException: Invalid Addresses; [INFO] [talledLocalContainer] nested exception is: [INFO] [talledLocalContainer] com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for signup-user@raibledesigns.com [INFO] [talledLocalContainer] [INFO] [talledLocalContainer] at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196) [INFO] [talledLocalContainer] at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584) [INFO] [talledLocalContainer] at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:403) [INFO] [talledLocalContainer] at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:308) [INFO] [talledLocalContainer] at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:297) [INFO] [talledLocalContainer] at org.appfuse.service.MailEngine.send(MailEngine.java:74) [INFO] [talledLocalContainer] at org.appfuse.service.MailEngine.sendMessage(MailEngine.java:64) [INFO] [talledLocalContainer] at org.appfuse.webapp.controller.BaseFormController.sendUserMessage(BaseFormController.java:193) ... As with my modification the Exception now doesn't break the code in MailEngine, an additional NullPointerException now pops up in SignupController on line 87, with exactly the same cause: > saveError(request, me.getCause().getLocalizedMessage()); The relevant part of this problem's stacktrace: [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet default threw exception [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at org.appfuse.webapp.controller.SignupController.onSubmit(SignupController.java:87) [INFO] [talledLocalContainer] at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267) [INFO] [talledLocalContainer] at org.appfuse.webapp.controller.BaseFormController.processFormSubmission(BaseFormController.java:150) [INFO] [talledLocalContainer] at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265) ... Note: The first stacktrace is the output of ex.printStackTrace()
If you change the following line:
saveError(request, me.getCause().getLocalizedMessage()); To: saveError(request, me.getCause().getMessage()); Does it solve the NPE? I'm sorry, I can't get the web module with the SignupController to install correctly (from a vanilla 2.0.1-tag checkout from svn), as tests are failing.
I can anyhow back up, that it will not solve the NPE. The call stack looks like this: - SignupController.onSubmit(...) - SignupController.sendUserMessage(...) - MailEngine.sendMessage(...) [throws MailException] The cause of the MailException in MailEngine is NULL (verified it and wrote it to the console). After the exception has been logged in MailEngine, it gets thrown again (MailEngine:78) and therefore bubbles up to the SignupController, where the cause still will be NULL as it's the exact same object. Thus the NPE will occur for the second time. |
|||||||||||||||||||||||||||||||||||||||||||||||
log.error(ex.getCause().getMessage());
to:
ex.printStackTrace();
And report the output?
Thanks,
Matt