You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Alexander Veit (JIRA)" <ji...@apache.org> on 2008/08/26 18:00:47 UTC

[jira] Created: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

XmlSchemaCollection does not handle multiple imports correctly
--------------------------------------------------------------

                 Key: WSCOMMONS-377
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
             Project: WS-Commons
          Issue Type: Bug
          Components: XmlSchema
            Reporter: Alexander Veit
            Priority: Blocker


JAX-WS frequently generates WSDL files with the following schema import pattern:

wsdl:
{code:xml}
  <types>
    <xsd:schema>
      <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
    </xsd:schema>
    <xsd:schema>
      <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
    </xsd:schema>
  </types>
{code}

xsd1:
{code:xml}
<xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
  <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
 <!-- element definitions -->
</xsd:schema>
{code}

xsd2:
{code:xml}
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
 <!-- type definitions -->
</xsd:schema>
{code}

XMLSchema cannot read both schema imports in the WSDL. It quits with

org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)

CXF-1624 is probably related to this bug.

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


[jira] Updated: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated WSCOMMONS-377:
---------------------------------------

        Fix Version/s: XmlSchema 1.4.4
             Assignee: Benson Margulies
    Affects Version/s: XmlSchema 1.4.3

> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>    Affects Versions: XmlSchema 1.4.3
>            Reporter: Alexander Veit
>            Assignee: Benson Margulies
>            Priority: Blocker
>             Fix For: XmlSchema 1.4.4
>
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Alexander Veit (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626750#action_12626750 ] 

Alexander Veit commented on WSCOMMONS-377:
------------------------------------------

The bug was introduced by a fix for WSCOMMONS-272 in the 1.4 branch (rev. 600626) and merged into trunk afterwards (rev. 639964).

An analog issue probably exists for xsd:import.

> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Resolved: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies resolved WSCOMMONS-377.
----------------------------------------

    Resolution: Fixed

The 'fix' is as follows:

You can now give each schema a unique, synthetic, system ID. 

If the schema imports other schemata, they will be found based on the base of the collection, if the
collection has a base.


> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>    Affects Versions: XmlSchema 1.4.3
>            Reporter: Alexander Veit
>            Assignee: Benson Margulies
>            Priority: Blocker
>             Fix For: XmlSchema 1.4.4
>
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

-- 
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: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Alexander Veit (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626750#action_12626750 ] 

veita edited comment on WSCOMMONS-377 at 8/28/08 2:37 PM:
-------------------------------------------------------------------

The bug was introduced by a fix for WSCOMMONS-272 in the 1.4 branch (rev. 600626) and merged into trunk afterwards (rev. 639964).

An analog issue probably exists for xsd:include.

      was (Author: veita):
    The bug was introduced by a fix for WSCOMMONS-272 in the 1.4 branch (rev. 600626) and merged into trunk afterwards (rev. 639964).

An analog issue probably exists for xsd:import.
  
> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656455#action_12656455 ] 

Benson Margulies commented on WSCOMMONS-377:
--------------------------------------------

The immediate problem in the initial report is that we have these 'schemas' that have no content except for their imports. No TNS, no SystemID, no nuthin. Long before the imports get into the act.

If the test case, which is simulating some product walking down the WSDL, gave each one a unique system ID, all would be well. I'm going to ensure that this is the case, and, if so, resolve this.


> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Jeff Faath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652128#action_12652128 ] 

Jeff Faath commented on WSCOMMONS-377:
--------------------------------------

Any new word on this issue?

We're getting hit with it in the Apache jUDDI project.  We're trying to expose the UDDI api as JAX-WS services.

Schema files are generated with imports.  So when a schema with the import is "read" (via XMLSchemaCollections#read) the import is also read into the collection.  Then when the actual schema file of the previously imported schema is read, the namespace conflict occurs.  

It appears that previously read schemas are contained in a Hashmap keyed by the target namespace.  So when a target namespace is read for the second time, it is rejected.


> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Updated: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Alexander Veit (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Veit updated WSCOMMONS-377:
-------------------------------------

    Attachment: wscommons-377.zip

> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656451#action_12656451 ] 

Benson Margulies commented on WSCOMMONS-377:
--------------------------------------------



Some of Dan's recent patches publicized an API that allows control on reading referenced imports. Does this help?

In general, I'm not sure about the definition of correct behavior would be for this collection of not entirely identical complaints.

I don't understand what it would mean for one collection to include multiple schemas with the same TNS. And if it's really the very same schema that gets imported and then read, why is this a problem to only accept it once.


> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Alexander Veit (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627524#action_12627524 ] 

Alexander Veit commented on WSCOMMONS-377:
------------------------------------------

The attached test case shows the problem.

As is turns out, the two schema elements that both have no targetNamespace attribute cause the error. It seems that the current implementation/API cannot handle this situation without major changes.

As a workaround I'll try to use the XmlSchemaCollection#read(Element, String) with a synthetic URI as second parameter instead of  XmlSchemaCollection#read(Element). However, since the API severely lacks documentation, it is not clear if this will work correctly in all circumstances.

> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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


[jira] Commented: (WSCOMMONS-377) XmlSchemaCollection does not handle multiple imports correctly

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652137#action_12652137 ] 

Benson Margulies commented on WSCOMMONS-377:
--------------------------------------------

This is a big-ish hard-ish problem, and I want to get a release out with a raft of smaller, easier, problems fixed before I tackle it.

Now, if you were to post a patch, I'd pull it into the release if at all possible.


> XmlSchemaCollection does not handle multiple imports correctly
> --------------------------------------------------------------
>
>                 Key: WSCOMMONS-377
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-377
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>            Reporter: Alexander Veit
>            Priority: Blocker
>         Attachments: wscommons-377.zip
>
>
> JAX-WS frequently generates WSDL files with the following schema import pattern:
> wsdl:
> {code:xml}
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
>     </xsd:schema>
>     <xsd:schema>
>       <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>     </xsd:schema>
>   </types>
> {code}
> xsd1:
> {code:xml}
> <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
>   <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
>  <!-- element definitions -->
> </xsd:schema>
> {code}
> xsd2:
> {code:xml}
> <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
>  <!-- type definitions -->
> </xsd:schema>
> {code}
> XMLSchema cannot read both schema imports in the WSDL. It quits with
> org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace: 
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)
> CXF-1624 is probably related to this bug.

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