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
Summary: Blank space around value of rhq.server.email.smtp-host property in rhq-server...
Keywords:
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ---
: RHQ 4.13
Assignee: Thomas Heute
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 1113591
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-26 13:31 UTC by bkramer
Modified: 2015-11-02 00:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Comment 2 bkramer 2014-06-26 14:23:12 UTC
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@server.com

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:

Comment 3 Libor Zoubek 2014-08-18 14:00:22 UTC
commit 8b3c5958208ab48b9a7c63e90824aa43a8b76958
Author: Libor Zoubek <lzoubek@redhat.com>
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


Note You need to log in before you can comment on or make changes to this bug.