Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1868

Schema imports not working in multiple class-loader environment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Java-SDO-1.0
    • Java-SDO-Next
    • 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.

      Attachments

        1. Test1868.java
          2 kB
          David T. Adcox
        2. 1868.patch
          1 kB
          David T. Adcox

        Activity

          People

            Unassigned Unassigned
            dtadcox David T. Adcox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: