[jboss-jira] [JBoss JIRA] (WFLY-13545) Smallrye OpenAPI annotaton scanner throws StackOverflowError when processing JAX-RS resource classes which implement a locator that will return the class itself

Paul Ferraro (Jira) issues at jboss.org
Mon Jun 1 17:05:01 EDT 2020


     [ https://issues.redhat.com/browse/WFLY-13545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Ferraro moved JBEAP-19601 to WFLY-13545:
---------------------------------------------

              Project: WildFly  (was: JBoss Enterprise Application Platform)
                  Key: WFLY-13545  (was: JBEAP-19601)
             Workflow: GIT Pull Request workflow   (was: CDW with loose statuses v1)
          Component/s: MP OpenAPI
                           (was: MP OpenAPI)
    Affects Version/s: 20.0.0.Beta1
                           (was: EAP-XP-1.0.0.GA-CR1)
                           (was: EAP-XP-1.0.0.GA-CR2)


> Smallrye OpenAPI annotaton scanner throws StackOverflowError when processing JAX-RS resource classes which implement a locator that will return the class itself
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-13545
>                 URL: https://issues.redhat.com/browse/WFLY-13545
>             Project: WildFly
>          Issue Type: Bug
>          Components: MP OpenAPI
>    Affects Versions: 20.0.0.Beta1
>            Reporter: Paul Ferraro
>            Assignee: Paul Ferraro
>            Priority: Major
>
> When deploying a WAR which contains a JAX-RS resource class which is declaring  a locator that is supposed to return the resource class itself - i.e. {{this}} - the depoyment fails with a {{StackOverflowError}}.
> The annotation scanner loops until the stack overflow happens because it tries to process the JAX-RS resource class recursively and maybe the process tself should be protected against this case.
> The following stack trace represents the output of a deployment failure when an attempt to deploy a WAR with such a resource:
> {code}
> at org.jboss.logging at 3.4.1.Final-redhat-00001//org.jboss.logging.Logger.getLogger(Logger.java:2490)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.dataobject.DataObjectDeque.<init>(DataObjectDeque.java:38)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.<init>(OpenApiDataObjectScanner.java:138)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.process(OpenApiDataObjectScanner.java:163)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.util.SchemaFactory.typeToSchema(SchemaFactory.java:360)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.createResponseFromJaxRsMethod(OpenApiAnnotationScanner.java:924)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsMethod(OpenApiAnnotationScanner.java:688)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.lambda$processJaxRsResourceClass$0(OpenApiAnnotationScanner.java:422)
> 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
> 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
> 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
> 	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
> 	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
> 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
> 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
> 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
> 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
> 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
> 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsResourceClass(OpenApiAnnotationScanner.java:420)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsSubResource(OpenApiAnnotationScanner.java:511)
>         at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsResourceClass(OpenApiAnnotationScanner.java:426)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsSubResource(OpenApiAnnotationScanner.java:511)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsResourceClass(OpenApiAnnotationScanner.java:426)
> 	at io.smallrye.openapi//io.smallrye.openapi.runtime.scanner.OpenApiAnnotationScanner.processJaxRsSubResource(OpenApiAnnotationScanner.java:511)
> ...
> {code}
> The failure was initially noticed during RESTEasy tests against EAP XP 1.0.0 CR1 and CR2.
> The SmallRye OpenAPI versions that I tested this against are 1.1.21 and 1.1.22.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list