Project

General

Profile

Actions

bug #9931

closed

Handle MailSendException in LoginPresenter and report accordingly

Added by Andreas Kohlbecker about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
New
Category:
cdm-vaadin
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:
Tags:

Description

Hallo,

Wenn ich auf localhost versuche mich zu registrieren bekomme ich wie erwartet einen Fehler. Allerdings wird der Fehler nicht abgefangen, sondern es kommt nur der Stacktrace. Vielleicht könnte man den noch abfangen.

Viele Grüße
Andreas M.

Jan 26, 2022 4:27:43 PM com.vaadin.server.DefaultErrorHandler doDefault

SCHWERWIEGEND:
java.lang.RuntimeException: A checked exception occurred while invoking listener method onPasswordRevoveryEvent
   ...
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;

  nested exception is:

      java.net.ConnectException: Connection refused: connect

      at java.util.concurrent.FutureTask.report(FutureTask.java:122)

      at java.util.concurrent.FutureTask.get(FutureTask.java:192)

      at eu.etaxonomy.cdm.vaadin.view.LoginPresenter.requestAccountCreation(LoginPresenter.java:268)

      at eu.etaxonomy.cdm.vaadin.view.LoginPresenter.onPasswordRevoveryEvent(LoginPresenter.java:175)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.vaadin.spring.events.internal.MethodListenerWrapper.publish(MethodListenerWrapper.java:78)

      ... 91 more

Caused by: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;

  nested exception is:

      java.net.ConnectException: Connection refused: connect. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;

  nested exception is:

      java.net.ConnectException: Connection refused: connect; message exceptions (1) are:

Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;

  nested exception is:

      java.net.ConnectException: Connection refused: connect

      at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:433)

      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:308)

      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:297)

      at eu.etaxonomy.cdm.api.service.security.AccountSelfManagementService.sendEmail(AccountSelfManagementService.java:104)

      at eu.etaxonomy.cdm.api.service.security.AccountRegistrationService.emailAccountRegistrationRequest(AccountRegistrationService.java:69)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)

      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:283)

      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

      at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)

      at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      ... 1 more

Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;

Actions #1

Updated by Andreas Kohlbecker about 2 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kohlbecker about 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #3

Updated by Andreas Kohlbecker about 2 years ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

I looks like the MailSendException is thrown very fast in Windows so that the error handling which was implemented so far could not catch the error.
I now changed the code a bit so that synchronously thrown MailSendExceptions are handled too, but can't test this on linux.

Please review.

Actions #4

Updated by Andreas Müller about 2 years ago

  • Target version changed from Release 5.45 to Release 5.29
Actions #5

Updated by Andreas Müller about 2 years ago

  • Assignee changed from Andreas Müller to Katja Luther

Katja, could you test this? I have currently problems starting a localhost vaadin server.

You simply need to start the vaadin server and use the register user app.

Actions #6

Updated by Andreas Müller about 2 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Katja Luther to Andreas Kohlbecker
  • % Done changed from 50 to 100

Now I got it running and it works as expected.

Actions

Also available in: Atom PDF