0

I have a java application with email sending service. Domain i set in Godaddy. In godaddy only we have office 365 account. Email sending is working fine in locally. But when i hosted in AWS ec2 ubuntu instance Emails are not being sent. Do i need to do any configuration in AWS. Thanks in advance. I am getting error in console as Exception: Velocity could not be Initialized.

Karthik
  • 39
  • 5
  • Is your EC2 on a private subnet? – Ashan Feb 01 '18 at 09:31
  • sorry i am not aware about subnet Terminology. I am a developer i am working on aws free basic account. Is this problem related to subnet means please provide me any related information.@Ashan – Karthik Feb 01 '18 at 14:01
  • You could try checking the Security Group's allowed ports and comparing them to what your email sending service wants to use. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html –  Feb 01 '18 at 19:23
  • office 365 is using Port 587 i already open even though not working. I am getting error in console as Exception: Velocity could not be Initialized. – Karthik Feb 02 '18 at 05:32

1 Answers1

0

I found the solution the main cause is velocity.log file was not able to create due to permission issues in AWS. TO create that log messages in tomcat log its self i updated this code

VelocityEngine engine = new VelocityEngine();

Properties props = new Properties();
props.put("runtime.log.logsystem.class","org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
props.put("runtime.log.logsystem.log4j.category", "velocity");
props.put("runtime.log.logsystem.log4j.logger", "velocity");

For more information check this link Error in velocity and log4J

Karthik
  • 39
  • 5