Bug 1104586 - Tomcat configured to use SSL is discovered as Tomcat(null) in RHQ
Summary: Tomcat configured to use SSL is discovered as Tomcat(null) in RHQ
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.12
Assignee: Jean-frederic Clere
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 1104581
TreeView+ depends on / blocked
 
Reported: 2014-06-04 09:11 UTC by bkramer
Modified: 2014-12-15 11:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-15 11:36:06 UTC
Embargoed:


Attachments (Terms of Use)

Description bkramer 2014-06-04 09:11:56 UTC
Description of problem:
Tomcat configured to use SSL is discovered as Tomcat(null) in JBoss ON

Version-Release number of selected component (if applicable):
RHQ 4.4
Tomcat 6

How reproducible:
Always

Steps to Reproduce:
1. Tomcat6/conf/server.xml connector config should contain something like:

    <Connector port="9441" protocol="HTTP/1.1" SSLEnabled="true"

               maxThreads="50" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="/home/guest/jboss/ews10/tomcat6/conf/tomcat.jks" 
               keystorePass="password"
               truststoreFile="/home/guest/jboss/ews10/tomcat6/conf/tomcat.truststore.jks" 
               truststorePass="password"/>

2.  ** self-signed cert tomcat server
    keytool -genkeypair  -keystore tomcat.jks -storepass password -keypass password -dname "cn=boom.usersys.redhat.com, ou=GSS,dc=redhat,dc=com" -alias tomcat  -keyalg RSA -keysize 1024 -validity 365
 
    ** self-signed cert browser
    keytool -genkeypair  -keystore client.keystore.jks -storepass password -keypass password -dname "cn=donkey.usersys.redhat.com, ou=GSS,dc=redhat,dc=com" -alias donkey -validity 365

    ** export tomcat server cert
    keytool -exportcert  -keystore tomcat.jks -alias tomcat -storepass password -file tomcat.cer
 
    ** export client cert
    keytool -exportcert  -keystore client.keystore.jks -alias donkey -storepass password -file client.cer
 
    ** import client cert to tomcat svr truststore
    keytool -importcert -keystore tomcat.truststore.jks -storepass password -alias donkey -file client.cer -noprompt

    ** import tomcat svr cert into client truststore
    keytool -importcert -keystore client.truststore.jks -storepass password -alias tomcat -file tomcat.cer -noprompt

3. Make the following changed in the Tomcat6/bin/startup.sh - top entry in the file:

   JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=7444 -Djava.rmi.server.hostname=127.0.0.1"
   JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=/home/guest/jboss/ews10/tomcat6/conf/access.properties"
   JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=/home/guest/jboss/ews10/tomcat6/conf/password.properties"
   JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"

Where  access.properties and password.properties were copied over from $JAVA_HOME/sample/jmx/jmx-scandir/src/etc/

4. Make sure that permissions are properly set for password.properties file:
   sudo chmod 0600 /home/guest/jboss/ews10/tomcat6/conf/password.properties

5. Start tomcat6 instance

6. Login to RHQ UI and navigate to the discovery queue - and it should show up Tomcat (null)

Actual results:
Tomcat instance is discovered but as Tomcat(null)

Expected results:
Tomcat instance is discovered properly with Tomcat(<port>)

Additional info:

The issue seems to be in the rhq/source/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/helper/TomcatConfig.java#146:

***********************************************************

             String scheme = attributes.getValue("scheme");
147             if ("https".equals(scheme)) {
148                 return;
149             }
150 
151             String className = attributes.getValue("className");
152             if (className != null) {
153                 if (className.endsWith("WarpConnector") //e.g. 4.0.x
154                     || className.endsWith("Ajp13Connector")) {
155                     return;
156                 }
157             }
158 
159             this.port = attributes.getValue("port");
160             this.address = attributes.getValue("address");
161         }
162 
163         protected String getPort() {
164             return port;
165         }
166 
167         protected String getAddress() {
168             return address;
169         }
170     }


***********************************************************

If schema is https no port or address is returned.

Comment 1 Heiko W. Rupp 2014-07-07 13:13:26 UTC
Merged in master

commit 8cca19810d4a684fd9f376328bc5e45054684845
Merge: a348010 fd63a38
Author: Thomas Segismont <tsegismont>
Date:   Fri Jun 13 09:58:54 2014 +0200

Comment 2 Heiko W. Rupp 2014-12-15 11:36:06 UTC
Bulk close of items fixed in RHQ 4.12

If you think this is not solved, then please open a *new* BZ and link to this one.


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