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

SchemaCollection throws StackOverflowError when schema contains circular reference

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.3
    • 2.2.4
    • Aegis Databinding
    • None

    Description

      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
      ...

      Attachments

        1. cxf-schemaCollection.patch
          2 kB
          Fried Hoeben

        Activity

          People

            dkulp Daniel Kulp
            fhoeben Fried Hoeben
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: