Bug 847379 - If agent does not have Internet access, XPath queries can fail
If agent does not have Internet access, XPath queries can fail
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 4, Plugin -- JBoss EAP 5 (Show other bugs)
JON 2.4.2
All All
high Severity high
: ER01
: JON 3.2.0
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On: 627023
  Show dependency treegraph
Reported: 2012-08-10 15:09 EDT by Larry O'Leary
Modified: 2014-01-02 15:36 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-02 15:36:24 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 167513 None None None 2012-08-10 15:09:48 EDT

  None (edit)
Description Larry O'Leary 2012-08-10 15:09:18 EDT
Description of problem:
When the plug-in is attempting to discover configuration for a resource using XML parsing via xquery or XPath and the target XML document contains a remote document definition or schema reference, an exception can be thrown during parsing if the agent host is unable to reach the remote resource.

This can be seen in the AS 4 plug-in when attempting to determine the context-root value for an Embedded WAR by performing and xquery on the parent EAR's application.xml file. If the application.xml contains an XML DOCTYPE definition such as:

    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">

And the agent machine is unable to resolve or reach java.sun.com, the result is an invalid value being used for the WAR's context-root property and MBean query property.

Although XPath expects a well-formed XML document, schema and DTD validation is not required to query the documents contents. Therefore, validation/verification and remote schema loading should be disabled to prevent application server artifacts such as deployment descriptors from breaking the plug-in.

This issue also applies to the host.xml in JBoss AS 7. Again, if document schema or definition is defined in the XML (which is standard by most development and validation tools), the result will be that the agent must also be able to reach those resources in order for the XPath operation to be possible unless we disable this validation.

Version-Release number of selected component (if applicable):
JON 2.4.2

How reproducible:

Steps to Reproduce:
1. Deploy an EAR which contains a WAR to JBoss AS making certain that the document defines a DOCTYPE or XML schema which references a remote URL
2. Add an alias for the remote URL to the agent machines /etc/hosts file to cause the host name mentioned in the URL to be unreachable.

   For example, if the URL is: http://java.sun.com/dtd/application_1_3.dtd
   Add the following to /etc/hosts	java.sun.com
3. Add the JBoss AS server to JON inventory
Actual results:
The WAR will be discovered by show as DOWN and its Context Root property will be set to - invalid - and its JBoss Web Name property will be <null>

Expected results:
The WAR should show UP and its Context Root and JBoss Web Name property should be valid.
Comment 1 mark yarborough 2012-11-06 15:05:22 EST
Per 3.1.2 triage with loleary, mfoley, ccrouch, asantos: Okay to move to JON 3.2.
Comment 2 Larry O'Leary 2013-06-03 14:13:05 EDT
Looks like this may have been done in master already with commits 09872c1 eff5f3c cacf370 as per upstream BZ627023.

Additionally testing instructions also available in upstream: see https://bugzilla.redhat.com/show_bug.cgi?id=627023#c4
Comment 3 Larry O'Leary 2013-09-06 10:33:15 EDT
As this is MODIFIED or ON_QA, setting milestone to ER1.
Comment 4 Filip Brychta 2013-12-10 10:58:48 EST
Verified on:
Version :	
Build Number :	

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