Description of problem: If a web application is deployed with a context of //localhost/myapps/helloworld it is ignored during service discovery. This is because the discovery logic attempts to confirm that the host name portion of the context path matches that of the Tomcat Virtual Host. This is done by using a regular expression to break the context into its host name and its path. The misbehaving regex is "//(.*)(/.*)" seen at http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatWarDiscoveryComponent.java;h=f6fa791585c796650e76544ef34917f2c9e07538;hb=6746535317a560e748a3753cb9ff4906ae6a468c#l61 With this regex, the host name becomes everything after the starting // up to the last /. A more appropriate regex with the minimalist of change would be: "//([^:/\\s]+)(/.*)" Version-Release number of selected component (if applicable): plugins-tomcat 3.0.1 How reproducible: Always Steps to Reproduce: 1. Create a directory called apps, one directory above where webapps resides 2. Copy helloworld.war into the apps directory 3. Edit server.xml and add: <Context docBase="../apps/helloworld.war" path="/myapps/helloworld" /> 4. Start the Tomcat server 5. Add the tomcat instance to inventory Actual results: All WARs are added to inventory except the helloworld.war Expected results: helloworld.war should have appeared as /myapps/helloworld
Created attachment 550546 [details] helloworld.war that should be deployed to non-standard location
Updated regular expression used to extract host name from context path in TomcatWarDiscoveryComponent.java. The regular expression now uses the value following the first // and before the next / as the host name. For example, //use.this.value.as.host.name/. http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=d1d18876b9f22a681e7243ef54aa649d066e8656 on master
This fix exposes the issue identified in Bug 772790 which is not directly related to this issue and should not prevent this issue from passing QA assuming that the correct web application context is displayed and functioning (available and being monitored).
verified as part of jon 2.4.2
This will be get fixed and tested in master via https://bugzilla.redhat.com/show_bug.cgi?id=784000 *** This bug has been marked as a duplicate of bug 784000 ***