Bug 772790 - Tomcat Web Application incorrectly discovered and imported into inventory when application is deployed outside of webapps base directory
Summary: Tomcat Web Application incorrectly discovered and imported into inventory whe...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.3
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-10 00:08 UTC by Larry O'Leary
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

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


Attachments (Terms of Use)
helloworld.war that should be deployed to non-standard location (866 bytes, application/octet-stream)
2012-01-10 00:08 UTC, Larry O'Leary
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 769470 0 high CLOSED TomcatWarDiscoveryComponent excludes valid WAR deployments due to eager host name regular expression 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 771495 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 771497 0 high CLOSED TomcatWarDiscoveryComponent excludes valid WAR deployments due to eager host name regular expression 2021-02-22 00:41:40 UTC

Internal Links: 769470 771495 771497

Description Larry O'Leary 2012-01-10 00:08:55 UTC
Created attachment 551724 [details]
helloworld.war that should be deployed to non-standard location

Description of problem:
When web application is deployed to an alternate location with non-default context name and unpackWARs=true for the Tomcat Virtual Host, the result is an invalid Tomcat Web Application deployment name added to inventory.

For example, if an application is deployed in ../apps (instead of ../webapps) and a context definition is added to the Tomcat Virtual Host as:

<Context docBase="../apps/helloworld.war" path="/myapps/helloworld" />

And a Tomcat Virtual Host definition such as:

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
...

The result is two Tomcat Web Application resources being added to inventory:

/myapps/helloworld
/myapps#helloworld

The first one is correct but the second one is incorrect and is a result of the unpackWARs option causing ../apps/helloworld.war being extracted to ../webapps/myapps#helloworld

Version-Release number of selected component (if applicable):
pre-4.3 based on master including http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=d1d18876b9f22a681e7243ef54aa649d066e8656

How reproducible:
Always

Steps to Reproduce:
1. Install Tomcat6 instance
2. Create a directory called apps, one directory above where webapps resides
3. Copy helloworld.war into the apps directory
4. Edit server.xml and add:
       <Context docBase="../apps/helloworld.war" path="/myapps/helloworld" />
5. Confirm that Virtual Host definition contains unpackWARs="true"
6. Start the Tomcat server
7. Add the tomcat instance to inventory
  
Actual results:
Two web application appear in inventory for helloworld app:
   /myapps/helloworld
   /myapps#helloworld


Expected results:
One web application appear in inventory for helloworld app:
   /myapps/helloworld


Additional info:
If unpackWARs is set to false, Tomcat will not extract the helloworld.war to the webapps directory and the result will be a single web application as described by the expected results.


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