[ 
https://issues.apache.org/jira/browse/CXF-2548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15119746#comment-15119746
 ] 

Amichai Rothman commented on CXF-2548:
--------------------------------------

I think I just came across the same issue while working on CXF-6737. If you 
take the sample project #3 attached there and set the test flag to use Aegis 
and then press the Go button twice - you will get this exception:
{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.service.model.ServiceInfo.addNewSchema(ServiceInfo.java:165)
        at 
org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:450)
        at 
org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:262)
        at 
org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
        at 
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:423)
        at 
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:525)
        at 
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261)
        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.dosgi.samples.greeter.client.BadClient.createServiceProxy(BadClient.java:45)
        at 
org.apache.cxf.dosgi.samples.greeter.client.BadClient.go(BadClient.java:50)
        at 
org.apache.cxf.dosgi.samples.greeter.client.GreeterDialog$4.actionPerformed(GreeterDialog.java:114)
        ...
{quote}

(tested with CXF 3.1.1, which is the version used by the latest DOSGi)

> Aegis component attempts to assign new schema objects with an existing 
> namespace URI to ServiceInfo if consecutive Clients are created for the same 
> WSDL causing XmlSchemaException: Schema name conflict in collection
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2548
>                 URL: https://issues.apache.org/jira/browse/CXF-2548
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>    Affects Versions: 2.2.5, 2.2.6
>         Environment: BEA JRockit 1.6.0 + WebLogic 10.3, Sun JDK 1.6.0
>            Reporter: Antal Varga
>            Priority: Critical
>             Fix For: Invalid
>
>
> Revision 826052 changed the behaviour of 
> org.apache.cxf.frontend.ClientFactoryBean.create() so that subsequent calls 
> will create new Client objects.
> The ServiceInfos are cached between the creation of these objects so that the 
> SchemaCollection objects assigned to them also remain the same.
> However when an endpoint is created (it is called for both of the Clients) 
> and org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas()
> is run then (line 457) a new SchemaInfo is attempted to be added to the 
> schema collection with a namespace URI already in the collection
> (see API component 
> org.apache.cxf.service.model.ServiceInfo.addNewSchema(String)) because it was 
> already added
> during the creation of the previous Client object.
> I think prior to adding the new SchemaInfo it should be checked if an entry 
> with the given namespace URI already exists.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to