CXF resolving the wrong XSD file when XSD filenames are identical on JBoss EAP 7.4

Solution In Progress - Updated -

Issue

When we deploy our WAR with JAX-WS webservices to JBoss EAP, in certain cases when requesting the WSDL/XSD from the running webservice endpoint using the URL suffix "?wsdl" the resolution of some referenced XSD's returns the wrong schemas.

The directory structure and schema imports for the sample look like the ones below:

org/example/common/common.xsd -> no schema imports
org/example/domain/common/common.xsd -> imports "../../common.xsd"
org/example/domain/service/schema/MyWebservice.xsd -> imports both "../../../common.xsd" and "../../common.xsd"
org/example/domain/service/MyWebservice.wsdl -> imports "schema/MyWebservice.xsd"

When requesting the WSDL from the running endpoint JBoss rewrites the schemaLocation attributes in XML schema imports in WSDL/XSD's to make it a valid URL with the real host name and with relative paths adjusted such that they are valid with respect to the location of the WSDL in the directory structure of the server and can thus be resolved by the client.
However, in the setup of the sample the resolution/lookup goes like this:

http://localhost:8080/wsdl-test/MyWebservice?wsdl -> ok
http://localhost:8080/wsdl-test/MyWebservice?xsd=schema/MyWebservice.xsd -> ok
http://localhost:8080/wsdl-test/MyWebservice?xsd=../common/common.xsd -> ok
http://localhost:8080/wsdl-test/MyWebservice?xsd=../../common/common.xsd -> not ok, returns the org/example/domain/common/common.xsd instead of the org/example/common/common.xsd, plus this time the result contains a not rewritten schemaLocation="../../common/common.xsd"

It looks like the key of the confusion might be that the schemaLocation value ../../common.xsd appears in two XSD's, namely in MyWebservice.xsd and in org/example/domain/common/common.xsd, where they point to different schemas, like neglecting the relative location of the containing XSD file. Things work fine when one of the common.xsd files is renamed or when one of them is located at a different directory level (e.g. when moving org/example/domain/common/common.xsd to org/example/domain/service/common/common.xsd)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.3
    • 7.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content