Problem in 1.4.0.1 - sending emails

Published on: 05/10/2017
Discussion

I've found an issue after the update of OSS version: while the configuration of the email is the same, the emails are not sent. The typical error is:

2017-09-26 22:54:15-125240071 [ajp-nio-8009-exec-1207] (RunnerController.java:1595) ERROR com.ec.survey.controller.BasicController  - Problem during sending the draft link. To:test@gmail.com Link:https://surveys.acer.europa.eu/eusurvey/runner/ec797379-f409-4f1d-9ce8-…
java.lang.NullPointerException
    at java.io.Reader.<init>(Unknown Source)
    at java.io.InputStreamReader.<init>(Unknown Source)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1906)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
    at com.ec.survey.controller.RunnerController.sendDraftLinkByMail(RunnerController.java:1588)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)

...

 

2017-09-26 22:57:17-125421931 [ajp-nio-8009-exec-1215] (RunnerController.java:1595) ERROR com.ec.survey.controller.BasicController  - Problem during sending the draft link. To:test@gmail.com Link:https://surveys.acer.europa.eu/eusurvey/runner/ec797379-f409-4f1d-9ce8-…
java.lang.NullPointerException
    at java.io.Reader.<init>(Unknown Source)
    at java.io.InputStreamReader.<init>(Unknown Source)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1906)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
    at com.ec.survey.controller.RunnerController.sendDraftLinkByMail(RunnerController.java:1588)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

....

2017-09-27 13:38:47-178312681 [taskExecutor-7] (AnswerExecutor.java:70) ERROR com.ec.survey.tools.AnswerExecutor  - 
java.lang.NullPointerException
    at java.io.Reader.<init>(Unknown Source)
    at java.io.InputStreamReader.<init>(Unknown Source)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1906)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
    at com.ec.survey.tools.AnswerExecutor.run(AnswerExecutor.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
2017-09-27 13:57:25-179429996 [taskExecutor-8] (

 

(full list on demand)

 

Please help.

Comments

Christian Lambert (not verified)
Wed, 10/01/2018 - 14:45

The problem is a missing template file. The bug will be fixed in the next version.

A quick solution might be to create a file "mailtemplateeusurvey.html" in the folder "WEB-INF\Content\EC". The content of the file can be any valid html code but it needs to have the placeholder "[CONTENT]" somewhere as it is used for the mail text.