Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1069349 - [GSS] (6.3.0) Schema imports in CXF can have naming conflicts in the URL used to retrieve them
[GSS] (6.3.0) Schema imports in CXF can have naming conflicts in the URL used...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web Services (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ER4
: EAP 6.3.0
Assigned To: Alessio Soldano
Rostislav Svoboda
Russell Dickenson
:
Depends On:
Blocks: 1069352 1084169 1087653 1100931 1103627
  Show dependency treegraph
 
Reported: 2014-02-24 14:41 EST by Kyle Lape
Modified: 2015-05-26 15:25 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A bug in previous releases of JBoss EAP 6 created naming conflicts in URLs when importing schema in CXF. This issue has been addressed in this release of the product.
Story Points: ---
Clone Of:
: 1069352 1084169 1100931 (view as bug list)
Environment:
Last Closed: 2014-06-28 11:45:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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
Apache JIRA CXF-4910 None None None Never

  None (edit)
Description Kyle Lape 2014-02-24 14:41:16 EST
The following description is copied from CXF-4910.

A following example results in incorrect behavior:

Namely:
WSDLGetUtils.updateSchemaImports() uses a map for caching processed schemata.
A service built from following path layout

Wsdl.wsdl
z/Types.xsd
z/z/Types.xsd

Where

- Wsdl.wsld imports z/Types.xsd(NS: http://example.com/NS1) using relative path
- z/Types.xsd imports z/Types.xsd(NS: http://example.com/NS2) using relative path (i.e. imports z/z/Types.xsd)

results in incorrect serving of service definition when querying the endpoint.

The link from wsdl to import points to "?xsd=z/Types.xsd".

<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://example.com/Service/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Service" targetNamespace="http://example.com/Service/">
  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://example.com/Service/" xmlns:sty="http://example.com/StructTypes" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://example.com/Service/">
      <xsd:import namespace="http://example.com/StructTypes" schemaLocation="http://localhost:8080/Service?xsd=z/Types.xsd"/>
    </xsd:schema>
    ...
  </wsdl:types>
  ...
</wsdl:definitions>

The link from z/Types.xsd points again to itself "?xsd=z/Types.xsd" (same content is served).
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:tns="http://example.com/StructTypes" 
  xmlns:bty="http://example.com/BaseTypes" 
  targetNamespace="http://example.com/StructTypes">
    <xsd:import namespace="http://example.com/BaseTypes" schemaLocation="http://localhost:8080/Service?xsd=z/Types.xsd"/>

This is because the WSDLGetUtils cuts of the schemata processing on the first import because relative path is used as key identifier in the schema map.

I suspect the same applies for the WSDL imports in WSDLGetUtils.updateDefinition() due to caching the definitions in the definition map.
Comment 3 Kyle Lape 2014-04-15 14:13:05 EDT
Note that while CXF-4910 was mostly fixed in CXF 2.7.11, there was another commit to complete the fix after 2.7.11 was tagged.

git commit ID: 80e89da70ac57017afaf712d2559d21a43e0b66a
Comment 4 Scott Mumford 2014-04-22 19:22:07 EDT
Flagged as Known Issue as ticket unresolved at the time of writing the release note.
Comment 5 Kabir Khan 2014-04-25 11:22:16 EDT
Setting to MODIFIED for ER4 (I believe the component upgrade solves this) since ER3 is the new beta candidate, and is ER2+beta blockers only
Comment 6 Jan Blizňák 2014-05-15 11:08:55 EDT
Verified on EAP 6.3.0 ER4.
For verification used custom application - based on schema import test from CXF.
Comment 7 Jim Ma 2014-05-21 00:41:55 EDT
(In reply to Kyle Lape from comment #3)
> Note that while CXF-4910 was mostly fixed in CXF 2.7.11, there was another
> commit to complete the fix after 2.7.11 was tagged.
> 
> git commit ID: 80e89da70ac57017afaf712d2559d21a43e0b66a

Just to add more details about this issue. This BZ is actually created for the schema import issue which Kyle provided the test case to reproduce the customer issue.  This git commit is actually fixed for another "schema include" issue Kyle spotted later after this. IMO, this should be created another BZ to track.
Comment 8 Jader 2015-05-04 19:26:51 EDT
This bug fix generates another bug. When importing second level xsd in a schema file, the schemaLocation attribute resolves wrong relative path, using ../../ or wathever. This bug persists in 6.3.x and 6.4.
Comment 9 Alessio Soldano 2015-05-26 15:25:51 EDT
Jader, sorry for the late reply. Any chance you can create a BZ or JIRA (upstream) issue with details for reproducing the issue?
Thanks

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