Holger Sunke created CXF-7159:
---------------------------------
Summary: Schema name conflict in collect when DTO class declares
XmlType namespace=http://www.w3.org/2001/XMLSchema
Key: CXF-7159
URL: https://issues.apache.org/jira/browse/CXF-7159
Project: CXF
Issue Type: Bug
Components: JAX-WS Runtime
Affects Versions: 3.1.8, 2.6.1
Environment: JDK 8
Reporter: Holger Sunke
I'm building my DTOs using wsdl2java and tried to set up a JaxWsProxyClient or
-Server which results in
{quote}
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)
{quote}
The offending DTO is an Exception object:
{quote}
@WebFault(name = "parameters", targetNamespace =
"http://www.w3.org/2001/XMLSchema")
public class SimpleFault extends Exception {
private java.lang.String parameters;
....
{quote}
Sources from WSDL:
{quote}
...
<wsdl:message name="SimpleFault">
<wsdl:part name="parameters" type="xsd:string"></wsdl:part>
</wsdl:message>
...
<wsdl:fault name="Servicefault" message="tns:SimpleFault" />
{quote}
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 hive devleoped a standalone test case you only need to extract and run "mvn
test" for reproducing this. How can I upload it?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)