[ 
https://issues.apache.org/jira/browse/CXF-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fried Hoeben updated CXF-2418:
------------------------------

    Attachment: cxf-schemaCollection.patch

Patch file that prevents the StackOverflowError, by ensuring that for each 
xmlSchema we only check each schemaElement once for cross imports, i.e. if it 
is encountered again it will be ignored.

> SchemaCollection throws StackOverflowError when schema contains circular 
> reference
> ----------------------------------------------------------------------------------
>
>                 Key: CXF-2418
>                 URL: https://issues.apache.org/jira/browse/CXF-2418
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>    Affects Versions: 2.2.3
>            Reporter: Fried Hoeben
>         Attachments: cxf-schemaCollection.patch
>
>
> When a schema contains a reference to an element inside itself, or there is 
> another circular reference between schemas,  
> SchemaCollection.addCrossImports() goes into infinite recursion ending with a 
> StackOverflowError.
> Sample stack (before the error):
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addElementCrossImportsElement(XmlSchema, 
> XmlSchemaObject) line: 353    
>       SchemaCollection.addCrossImportsSequence(XmlSchema, XmlSchemaSequence) 
> line: 376        
>       SchemaCollection.addCrossImportsType(XmlSchema, XmlSchemaType) line: 
> 366        
>       SchemaCollection.addOneSchemaCrossImports(XmlSchema) line: 342  
>       SchemaCollection.addCrossImports() line: 321    
>       Databinding(AegisDatabinding).createSchemas(Service, Set<Type>) line: 
> 504       
>       Databinding(AegisDatabinding).initialize(Service) line: 285     
>       
> JaxWsServiceFactoryBean(ReflectionServiceFactoryBean).buildServiceFromWSDL(String)
>  line: 346    
>       
> JaxWsServiceFactoryBean(ReflectionServiceFactoryBean).initializeServiceModel()
>  line: 442        
>       JaxWsServiceFactoryBean(ReflectionServiceFactoryBean).create() line: 
> 195        
>       JaxWsServiceFactoryBean.create() line: 163      
>       
> JaxWsClientFactoryBean(AbstractWSDLBasedEndpointFactory).createEndpoint() 
> line: 100     
>       JaxWsClientFactoryBean(ClientFactoryBean).create() line: 52     
>       JaxWsProxyFactoryBean(ClientProxyFactoryBean).create() line: 102        
>       JaxWsProxyFactoryBean.create() line: 115        
> ...

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

Reply via email to