java.net.UnknownHostException thrown during JBoss ON Server start up
Issue
- JBoss ON Server starts with errors and
java.net.UnknownHostExceptionis logged in the server.log file when trying to reach mail server:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.mail-session.java:jboss/mail/Default: org.jboss.msc.service.StartException in service jboss.mail-session.java:jboss/mail/Default: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Caused by: java.lang.RuntimeException: JBAS015451: Unknown host for outbound socket binding configuration 'mail-smtp'.
at org.jboss.as.mail.extension.MailSessionService.getServerSocketAddress(MailSessionService.java:163)
at org.jboss.as.mail.extension.MailSessionService.setServerProps(MailSessionService.java:131)
at org.jboss.as.mail.extension.MailSessionService.getProperties(MailSessionService.java:90)
at org.jboss.as.mail.extension.MailSessionService.start(MailSessionService.java:64)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
... 3 more
Caused by: java.net.UnknownHostException: my.smtp.server.com
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) [rt.jar:1.7.0_17]
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866) [rt.jar:1.7.0_17]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258) [rt.jar:1.7.0_17]
at java.net.InetAddress.getAllByName0(InetAddress.java:1211) [rt.jar:1.7.0_17]
at java.net.InetAddress.getAllByName(InetAddress.java:1127) [rt.jar:1.7.0_17]
at java.net.InetAddress.getAllByName(InetAddress.java:1063) [rt.jar:1.7.0_17]
at java.net.InetAddress.getByName(InetAddress.java:1013) [rt.jar:1.7.0_17]
at org.jboss.as.network.OutboundSocketBinding.getDestinationAddress(OutboundSocketBinding.java:146)
at org.jboss.as.mail.extension.MailSessionService.getServerSocketAddress(MailSessionService.java:161)
... 8 more
- When testing smtp configuration in JBoss ON, using the admin test tool - http://server:7080/coregui/#Test/ServerAccess/EmailTest, I am getting:
Error: javax.ejb.EJBException: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
- The alert was fired but email notification is not sent and I can see the error in the log file:
ERROR [org.rhq.enterprise.server.alert.AlertManagerBean] (Thread-21) Failed to send all notifications for Alert[id=10011]: javax.persistence.TransactionRequiredException: JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)
- Email sending by JON is broken
- java.net.UnknownHostException thrown during JBoss ON Server start up
- Blank space characters around value of rhq.server.email.smtp-host property (in rhq-server.properties file) will cause errors during start up of JBoss ON Server.
Environment
- Red Hat JBoss Operations Network (JON) 3.2, 3.3
$JON-SERVER/bin/rhq-server.propertiesfile is set to use smtp server in the following way:
# Email settings used to connect to an SMTP server to send alert emails.
rhq.server.email.smtp-host=my.smtp.server.com
rhq.server.email.smtp-port=25
rhq.server.email.from-address=user@server.com
- Restarted JBoss ON Server
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.