Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Java-SDO-1.0
-
None
-
n/a
Description
There is a problem with loading schemas that import an additional namespace when in a multiple class-loader environment. The problem exists due to a design flaw in how the EcoreBuilder and package registries interact under a specific circumstance. That circumstance exists when the default helper context is used to load a schema model using the XSDHelper.define() method in two different, peer class-loaders. These peer class-loaders must share the same parentage.
---------------
CL parent |
---------------
/\
/ \
/ \
/ \
------- -------
CL1 | CL2 |
------- -------
In this scenario, the same EcoreBuilder is used on both passes of XSDHelper.define(), because the EcoreBuilder is associated with the CL Parent. A unique registry is created for CL1 and another for CL2. During the processing for CL1, the target namespace and all imported namespaces are properly parsed and the models stored in the associated registry, but during the processing for CL2, because the same EcoreBuilder is used, only the target namespace is processed. So, any imported models are missing from the CL2 registry.
I've attached an example that will demonstrate this issue.