Description of problem: Blank space around value of rhq.server.email.smtp-host property in rhq-server.properties is not removed and causes java.net.UnknownHostException when starting RHQ server Version-Release number of selected component (if applicable): RHQ 4.9 How reproducible: Always Steps to Reproduce: 1. Open $RHQ-SERVER/bin/rhq-server.properties file 2. Find and change the values for the mail server in something like: # 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 but make sure to have one (or more) additional blank space characters after my.smtp.server.com (to check this double-click on the value and see what is highlighted) 3. Save the change and start the RHQ Server. Actual results: The EAP server where RHQ is running is running but with errors and the following Exception is thrown during start up: ******************** 16:15:47,961 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 ******************** and later: ******************** 16:16:58,037 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014777: Services which 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 16:16:58,144 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:6990/management 16:16:58,145 INFO [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled 16:16:58,145 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.1.1.GA (AS 7.2.1.Final-redhat-10) started (with errors) in 78391ms - Started 4934 of 5043 services (1 services failed or missing dependencies, 104 services are passive or on-demand) ******************** Expected results: Server is started and no exception is thrown. Additional info:
commit 8b3c5958208ab48b9a7c63e90824aa43a8b76958 Author: Libor Zoubek <lzoubek> Date: Mon Aug 18 15:56:46 2014 +0200 Bug 1113593 - Blank space around value of rhq.server.email.smtp-host property in rhq-server.properties is not removed and causes java.net.UnknownHostException when starting RHQ server Added a check to rhqctl start & install commands that prints warnings in case it finds lines with trailing spaces in rhq-server.properties file