Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7159

Schema name conflict in collect when DTO class declares XmlType namespace=http://www.w3.org/2001/XMLSchema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6.1, 3.1.8
    • None
    • JAX-WS Runtime
    • None
    • JDK 8

    • Unknown

    Description

      I'm building my DTOs using wsdl2java and tried to set up a JaxWsProxyClient or -Server which results in

      org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection
      at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:126)
      at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:140)
      at org.apache.cxf.common.xmlschema.SchemaCollection.newXmlSchemaInCollection(SchemaCollection.java:194)
      at org.apache.cxf.jaxb.JAXBSchemaInitializer.createBridgeXsElement(JAXBSchemaInitializer.java:355)
      at org.apache.cxf.jaxb.JAXBSchemaInitializer.checkForExistence(JAXBSchemaInitializer.java:333)
      at org.apache.cxf.jaxb.JAXBSchemaInitializer.begin(JAXBSchemaInitializer.java:150)
      at org.apache.cxf.service.ServiceModelVisitor.visitOperation(ServiceModelVisitor.java:120)
      at org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:74)
      at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:396)
      at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469)
      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:696)
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:529)
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
      at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
      at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
      at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
      at schemaConflict.TestSchemaConflict.testSchemaConflict(TestSchemaConflict.java:28)

      The offending DTO is an Exception object:

      @WebFault(name = "parameters", targetNamespace = "http://www.w3.org/2001/XMLSchema")
      public class SimpleFault extends Exception {
      private java.lang.String parameters;
      ....

      Sources from WSDL:

      ...
      <wsdl:message name="SimpleFault">
      <wsdl:part name="parameters" type="xsd:string"></wsdl:part>
      </wsdl:message>
      ...
      <wsdl:fault name="Servicefault" message="tns:SimpleFault" />

      The offending Namespace http://www.w3.org/2001/XMLSchema is already added on schema collection instantiation and thus a conflict is determined as soon as the SimpleFault is hit on initialization.

      I have devleoped a standalone test case you only need to extract and run "mvn test" for reproducing this. How can I upload it?

      Attachments

        1. schemaConflict.7z
          2 kB
          Holger Sunke
        2. schemaConflict_v2.7z
          2 kB
          Holger Sunke

        Activity

          People

            Unassigned Unassigned
            holger.sunke@bodo-peters.de Holger Sunke
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: