You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Scott Kurz (JIRA)" <de...@tuscany.apache.org> on 2008/07/08 16:56:31 UTC

[jira] Created: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
-----------------------------------------------------------------------

                 Key: TUSCANY-2465
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Data Binding Runtime
         Environment: Roughly SCA Java 1.3
            Reporter: Scott Kurz


When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 

org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)

The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:

        for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
            XMLTypeHelper helper = helpers.get(en.getKey());
            if (helper == null) {
                continue;
            }
            List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
            for (XSDefinition xsDef: xsDefinitions) {
                addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
            }
        }

The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.

Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng resolved TUSCANY-2465.
-----------------------------------

    Resolution: Fixed

Fixed the JAXBContext issue. Please verify.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Kurz resolved TUSCANY-2465.
---------------------------------

    Resolution: Fixed

That looks good.  Thanks for the fix.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Simon Nash (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612211#action_12612211 ] 

Simon Nash commented on TUSCANY-2465:
-------------------------------------

I traced through the databinding/jaxb-bottom-up test and I did not see any duplicate calls that load schemas from the same namespace.  However, I believe that this could happen if some wrappers have generated classes and others don't, as this would cause a call to loadXSD() to load a helper-generated schema followed by another call to loadXSD() to load a locally generated wrapper schema.  Scott, is it possible that this was happening in your test?

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612358#action_12612358 ] 

Scott Kurz commented on TUSCANY-2465:
-------------------------------------

Simon, 

I don't understand the purpose of every line in this generator, but after looking at this some more...

It seems the issue with my test was simply that a Java intf method referenced types which mapped to schema defs in the same TNS as the TNS of the wrapper elems.    

I forget exactly where but I think we define the wrapper DataType(s) within the TNS  mapped to by the package of the Java interface, so if one of our input/output/fault types defines an entry in that same TNS, we will do the loadXSD() twice.    

I'll attach a quick patch to show this in trace/debug....

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Kurz updated TUSCANY-2465:
--------------------------------

    Attachment: 2465.hacked.test.diff

This is not a patch .. just a demonstration.. it's not a fleshed out test and is only useful if your tracing or stepping through the debug of this generate() method we've been discussing.

(Note the package-info.java defines a NS for the Bean2 class.   Without this namespace we actually end up with a schema associated with the null NS and so won't recreate this exact issue.)

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>         Attachments: 2465.hacked.test.diff
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng resolved TUSCANY-2465.
-----------------------------------

    Resolution: Fixed

A fix is checked in under r674894 & r674933. I'll merge it into 1.3 branch.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Kurz reopened TUSCANY-2465:
---------------------------------


Sorry, I didn't see Simon's comment until after marking this as resolved.   I'll re-open it, though the patch resolved my problem, so the discussion can continue.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Kurz reopened TUSCANY-2465:
---------------------------------


Thanks for the quick patch, but unfortunately this just postpones the problem a bit.  

I now hit the problem after building the wrapperXSDs XSDefinitions:

            // resolve XSDefinitions containing generated wrappers
            for (XSDefinition xsDef: wrapperXSDs.values()) {
                loadXSD(schemaCollection, xsDef);
                wsdlDefinition.getXmlSchemas().add(xsDef);
            }

My stack trace (for what it's worth, you can see I'm using the old path name for the generator):

Caused by: org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://blah
	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:355)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:303)
	at org.apache.tuscany.sca.interfacedef.wsdl.java2wsdl.Java2WSDLHelper.createWSDLInterfaceContract(Java2WSDLHelper.java:193)

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611831#action_12611831 ] 

Raymond Feng commented on TUSCANY-2465:
---------------------------------------

I found the regression too. Just fixed it under r675006 in trunk and r675008 in 1.3 branch.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng reassigned TUSCANY-2465:
-------------------------------------

    Assignee: Raymond Feng

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng reopened TUSCANY-2465:
-----------------------------------


Just noticed you have two issues. The latest fix solves the JAXBContext only

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "ant elder (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder closed TUSCANY-2465.
------------------------------

    Resolution: Fixed

Closing as it appears everyone is happy for now with the current fix

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>         Attachments: 2465.hacked.test.diff
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Simon Nash (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611677#action_12611677 ] 

Simon Nash commented on TUSCANY-2465:
-------------------------------------

The problem is caused by multiple calls to the JAXBDataBinding.getXMLTypeHelper() method returning different instance objects, which show up as different entries in the helpers map in Interface2WSDLGenerator.  There are also separate lists of DataTypes created by getDataTypes()/addDataType() for different databinding names of the same helper type.

I think the simplest fix is
1. Change JAXBDataBinding to return a singleton instance of JAXBTypeHelper instead of always creating a new instance.
2. In Interface2WSDLGenerator, ensure that the map of databinding names to XMLTypeHelper instances reuses the same instance for different names where possible.  This should happen automatically as a result of change 1.
3. Index the map of DataType lists that's returned by getDataTypes() by helper instance rather than by the databinding name.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Simon Nash (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612407#action_12612407 ] 

Simon Nash commented on TUSCANY-2465:
-------------------------------------

Thanks for this code, which has helped me understand what is causing the problem.  The duplicate loadXSD() calls for the same schema TNS will occur in either of the following cases:
1. An XMLTypeHelper returns schema definitions for some application types, and Interface2WSDLGenerator creates wrappers in the same namespace as those application types.
2. An XMLTypeHelper returns schema definitions for some wrappers, and Interface2WSDLGenerator creates wrappers in the same namespace as those wrappers.

The fix that Raymond checked in works because it gives unique IDs to the XSDefinition objects for the wrappers created by Interface2WSDLGenerator, thus preventing a clash with any XSDefinition objects for schemas returned by an XMLTypeHelper.

It isn't actually necessary to give unique IDs to different XSDefinition objects for the wrappers created by Interface2WSDLGenerator, because the clash is not between different instances of these objects.  Any value that's non-null would be enough to prevent the clash between these objects and the XSDefinition objects created by the XMLTypeHelper.

This area could be revisited if/when the XMLTypeHelper code is changed to import from existing schemas in the contribution rather than copying them inline.  I think this will require helpers that do this to set a non-null location value in the XSDefinition objects that they create.  If the helpers were to always set a non-null unique location value in these XSDefinition objects, there would be no need for Interface2WSDLGenerator to set a non-null location valuein the XSDefinition objects that it creates for generated wrappers.


> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>         Attachments: 2465.hacked.test.diff
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611836#action_12611836 ] 

Raymond Feng commented on TUSCANY-2465:
---------------------------------------

Add one more fix under r675013 in trunk and r675016 in 1.3, please verfiy before I mark this JIRA resolved :-)

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "ant elder (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder updated TUSCANY-2465:
-------------------------------

    Fix Version/s: Java-SCA-1.3

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611829#action_12611829 ] 

Scott Kurz commented on TUSCANY-2465:
-------------------------------------

Actually I found a 2nd problem with the new code.   Actually the stack trace I used when re-opening the JIRA was from a different test.  When I retry my original test (the itest/databinding/jaxb-bottom-up test), I actually fail earlier with error:

---------

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://jaxb.dev.java.net/array}base64BinaryArray". Use @XmlType.name and @XmlType.namespace to assign different names to them.
	this problem is related to the following location:
		at javax.xml.transform.Source[]
	this problem is related to the following location:
		at javax.activation.DataHandler[]
	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:270)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:81)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:599)
	at com.ibm.xml.xlxp2.jaxb.JAXBContextImpl.createFallbackContext(JAXBContextImpl.java:243)
	at com.ibm.xml.xlxp2.jaxb.JAXBContextImpl.<init>(JAXBContextImpl.java:130)
	at com.ibm.xml.xlxp2.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:599)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
	at org.apache.tuscany.sca.databinding.jaxb.JAXBContextCache.getJAXBContext(JAXBContextCache.java:270)
	at org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper.createJAXBContext(JAXBContextHelper.java:179)
	at org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper.createJAXBContext(JAXBContextHelper.java:211)
	at org.apache.tuscany.sca.databinding.jaxb.JAXBTypeHelper.getSchemaDefinitions(JAXBTypeHelper.java:227)
	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:212)
	at org.apache.tuscany.sca.interfacedef.wsdl.java2wsdl.Java2WSDLHelper.createWSDLInterfaceContract(Java2WSDLHelper.java:193)

---------

Note this is on a Java V6 JRE... also, though it uses IBM XLXP it seems to defer to the Sun RI JAXB impl (not sure exactly why).  



> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Simon Nash (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611956#action_12611956 ] 

Simon Nash commented on TUSCANY-2465:
-------------------------------------

I'd like to understand more about the scenario that causes this to happen.  It appears there are multiple wrapper schema definitions and XSDefinition objects being generated for the same target namespace.  This seems to indicate a problem somewhere in either the wrapper generation or schema generation logic.  The change in r675013 looks like a workaround to suppress the symptoms of this problem (by loading the same XSD twice) without addressing the deeper root cause.

> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TUSCANY-2465) J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS

Posted by "Scott Kurz (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612359#action_12612359 ] 

scottkurz edited comment on TUSCANY-2465 at 7/9/08 7:46 PM:
-------------------------------------------------------------

This is not a patch .. just a demonstration.. it's not a fleshed out test and is only useful if you're tracing or stepping through the debug of this generate() method we've been discussing.

(Note the package-info.java defines a NS for the Bean2 class.   Without this namespace we actually end up with a schema associated with the null NS and so won't recreate this exact issue.)

      was (Author: scottkurz):
    This is not a patch .. just a demonstration.. it's not a fleshed out test and is only useful if your tracing or stepping through the debug of this generate() method we've been discussing.

(Note the package-info.java defines a NS for the Bean2 class.   Without this namespace we actually end up with a schema associated with the null NS and so won't recreate this exact issue.)
  
> J2W Interface2WSDLGenerator should only call SchemaBuilder once per TNS
> -----------------------------------------------------------------------
>
>                 Key: TUSCANY-2465
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2465
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>         Environment: Roughly SCA Java 1.3
>            Reporter: Scott Kurz
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.3
>
>         Attachments: 2465.hacked.test.diff
>
>
> When trying the equivalent of the itest/databindings/jaxb-bottom-up test with a newer version of XMLSchema (newer than the 1.3.2 version Tuscany depends on), I hit an error 
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: http://jaxb.dev.java.net/array
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:104)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:83)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:424)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:418)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.loadXSD(Interface2WSDLGenerator.java:354)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.addSchemaExtension(Interface2WSDLGenerator.java:336)
> 	at org.apache.tuscany.sca.interfacedef.wsdl.interface2wsdl.Interface2WSDLGenerator.generate(Interface2WSDLGenerator.java:213)
> The problem lies in Interface2WSDLGenerator.generate(), with this excerpt:
>         for (Map.Entry<String, List<DataType>> en: getDataTypes(interfaze, false).entrySet()) {
>             XMLTypeHelper helper = helpers.get(en.getKey());
>             if (helper == null) {
>                 continue;
>             }
>             List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
>             for (XSDefinition xsDef: xsDefinitions) {
>                 addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
>             }
>         }
> The getDataTypes(interfaze,false) does its introspection of the DataType(s) and returns a pair of Map.Entry(s).  One has key:  simpleType, and one has key: complexType.    For each of these keys, the call to helpers.get(en.getKey()) returns the JAXTypeHelper, and each results into addSchemaExtension() which in turn calls loadXSD() which I showed in the stack trace.   And the problem is each call involves an XMLSchema def with the same TNS, http://jaxb.dev.java.net/array.
> Somehow we need to reduce this to one call to SchemaBuilder or we'll break this test when we upgrade our XMLSchema dependency.   (Not sure what if anything is broken on this level of XMLSchema since the 2nd call ends up as a no-op).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.