SMTP configuration

0

Hello,

I have a "jasperreports-server-cp-5.5.0a" on a "Windows 2008 Server R2" OS.
I have configured js.quartz.properties file for sending emails.
But cannot send mails. As i understand it tries connect to "mail.localhost.com" but i writed an IP adress as mail server in the configuration file. 

Configuration and error messages are below.
Any help will be appreciated, thanks.

_________________________

quartz.delegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate

quartz.tablePrefix=QRTZ_
quartz.extraSettings=

report.scheduler.web.deployment.uri=http://localhost:8080/jasperserver

report.scheduler.mail.sender.host=IP.adress
report.scheduler.mail.sender.username=xx@yy.com
report.scheduler.mail.sender.password=xxxx
report.scheduler.mail.sender.from=xx@yy.com
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=25

_____________________________

Subject:
The job failed to execute. Review its parameters.

Date:
Today

Component:
Report Scheduler

Message:
Job: nrtest1 (ID: 729) Report unit: /reports/REPORT_DAILY_16 Quartz Job: ReportJobs.job_729 Quartz Trigger: ReportJobs.trigger_726_0 Exceptions: The job error notification was not completed. An error occurred while sending it. org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com. Failed messages: javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com; message exception details (1) are: Failed message 1: javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) at javax.mail.Service.connect(Service.java:275) at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJobMailNotificationImpl.sendMailNotification(ReportExecutionJobMailNotificationImpl.java:135) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:953) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:549) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:217) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: java.net.UnknownHostException: mail.localhost.com at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250) ... 11 more

fnurie's picture
42
Joined: Apr 17 2014 - 7:05am
Last seen: 4 years 8 months ago

Does your SMTP server require authentication?

adam_7 - 5 years 6 months ago

3 Answers:

1

I found the problem,

I was editing this file : "\jasperreports-server-cp-5.5.0a\buildomatic\build_conf\default\webapp\WEB-INF\js.quartz.properties"
but
it should be this file: " \jasperreports-server-cp-5.5.0a\apache-tomcat\webapps\jasperserver\WEB-INF\js.quartz.properties"
fnurie's picture
42
Joined: Apr 17 2014 - 7:05am
Last seen: 4 years 8 months ago
0

I would check this file and set the authentication option to true if your SMTP server requires authentication.

 

$TOMCAT/webapps/jasperserver/WEB-INF/applicationContext-report-scheduling.xml

 

and change the following option..

 

<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>

adam_7's picture
39
Joined: Jan 27 2014 - 7:59am
Last seen: 1 year 1 week ago
1

Hi adam_7,

Authentication was false in the applicationContext-report-scheduling.xml file, so i changed it as you described and restarted jasperserver. However smtp error seems to not changed:

Job: denemepazar2 (ID: 785) Report unit: /reports/REPORT_HOURLY_16 Quartz Job: ReportJobs.job_785 Quartz Trigger: ReportJobs.trigger_782_0 Exceptions: The job error notification was not completed. An error occurred while sending it. org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com. Failed messages: javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com; message exception details (1) are: Failed message 1: javax.mail.MessagingException: Unknown SMTP host: mail.localhost.com; nested exception is: java.net.UnknownHostException: mail.localhost.com at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) at javax.mail.Service.connect(Service.java:275) at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJobMailNotificationImpl.sendMailNotification(ReportExecutionJobMailNotificationImpl.java:135) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:953) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:549) at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:217) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: java.net.UnknownHostException: mail.localhost.com at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250) ... 11 more

fnurie's picture
42
Joined: Apr 17 2014 - 7:05am
Last seen: 4 years 8 months ago

Your smtp server is "mail.localhost.com"? are you sure your smtp settings are set up correctly?

adam_7 - 5 years 6 months ago
Feedback