Bug 772790 - Tomcat Web Application incorrectly discovered and imported into inventory when application is deployed outside of webapps base directory
Tomcat Web Application incorrectly discovered and imported into inventory whe...
Status: NEW
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.3
Unspecified Unspecified
high Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-09 19:08 EST by Larry O'Leary
Modified: 2012-01-16 15:59 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Larry O'Leary 2012-01-09 19:08:55 EST
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.