[JIRA] Created: (APF-1016) NullPointerException in MailEngine

9 messages Options
Embed this post
Permalink
AppFuse - Issues mailing list

[JIRA] Created: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
NullPointerException in MailEngine
----------------------------------

                 Key: APF-1016
                 URL: http://issues.appfuse.org/browse/APF-1016
             Project: AppFuse
          Issue Type: Bug
          Components: Service Layer
    Affects Versions: 2.0.1
         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
            Reporter: Tobias Vogel
            Assignee: Matt Raible
            Priority: Minor


I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.

The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:

> log.error(ex.getCause().getMessage());

The relevant part of the stacktrace:

[INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
[INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
[INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink

    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12329 ]

Matt Raible commented on APF-1016:
----------------------------------

Can you change:

log.error(ex.getCause().getMessage());

to:

ex.printStackTrace();

And report the output?

Thanks,

Matt

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12330 ]

Tobias Vogel commented on APF-1016:
-----------------------------------

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 '[hidden email]', 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 [hidden email]
[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)
...

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12331 ]

Tobias Vogel commented on APF-1016:
-----------------------------------

Note: The first stacktrace is the output of ex.printStackTrace()

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12336 ]

Matt Raible commented on APF-1016:
----------------------------------

If you change the following line:

saveError(request, me.getCause().getLocalizedMessage());

To:

saveError(request, me.getCause().getMessage());

Does it solve the NPE?

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12338 ]

Tobias Vogel commented on APF-1016:
-----------------------------------

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.

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Updated: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

     [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Raible updated APF-1016:
-----------------------------

    Fix Version/s: 2.0.2

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>             Fix For: 2.0.2
>
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

AppFuse - Issues mailing list

[JIRA] Resolved: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list

     [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Raible resolved APF-1016.
------------------------------

    Resolution: Fixed

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>             Fix For: 2.0.2
>
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

SorinPostelnicu

Re: [JIRA] Commented: (APF-1016) NullPointerException in MailEngine

Reply Threaded More More options
Print post
Permalink
In reply to this post by AppFuse - Issues mailing list
Dear Matt,

I have the same issue listed here, even now in version 2.0.2 of Appfuse (and I see that actually the problem is also in the trunk).
In my case the MailException I guess is generated because I don't use a "normal" mail server, but I use FreeSMTPServer on my local Windows machine.

Anywow, the problem as I see it is that me.getCause() returns null, so me.getCause().getLocalizedMessage() will throw NullPointerException.

This problem appears in two Controller files: in UserFormController (line 128) and in PasswordHintController (line 91).

The simplest solution is to replace these lines with:
saveError(request, me.getMostSpecificCause().getLocalizedMessage());

This will make it similar to SignupController (line 87).
And for that matter, you can also replace line 87 with the same line as above, to call getLocalizedMessage() instead of getMessage(), for the sake of consistency :)


All the best,
Sorin

P.S. Congratulations for the excellent Appfuse framework, and keep up the good work.



AppFuse - Issues mailing list wrote:
    [ http://issues.appfuse.org/browse/APF-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12329 ]

Matt Raible commented on APF-1016:
----------------------------------

Can you change:

log.error(ex.getCause().getMessage());

to:

ex.printStackTrace();

And report the output?

Thanks,

Matt

> NullPointerException in MailEngine
> ----------------------------------
>
>                 Key: APF-1016
>                 URL: http://issues.appfuse.org/browse/APF-1016
>             Project: AppFuse
>          Issue Type: Bug
>          Components: Service Layer
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP2, Java(TM) SE Runtime Environment (build 1.6.0_03-b05), Microsoft Exchange 2003
>            Reporter: Tobias Vogel
>            Assignee: Matt Raible
>            Priority: Minor
>
> I edited my mail.properties (in core and web) to use our internal Exchange server to send mails. During the build process a test mail gets sent (password hint), resulting in a NullPointerException. This exception is not caused by wrong settings, as my mail actually gets delivered.
> The strange thing is, the "mailSender" later on seems to anyhow throw an exception (though having successfully delivered the mail), which breaks the exception logging code in MailSender. The reason should be, that there's no cause in the exception, leading to brak the following code in MailSender:
> > log.error(ex.getCause().getMessage());
> The relevant part of the stacktrace:
> [INFO] [talledLocalContainer] SCHWERWIEGEND: Servlet.service() for servlet dispatcher threw exception
> [INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer]   at org.appfuse.service.MailEngine.send(MailEngine.java:77)
> [INFO] [talledLocalContainer]   at org.appfuse.webapp.controller.PasswordHintController.handleRequest(PasswordHintController.java:84)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> [INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> ...

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@appfuse.dev.java.net
For additional commands, e-mail: issues-help@appfuse.dev.java.net