Wildfly migration from 26 to 32 - OpenApi with multiple rest endpoints issue

88 views
Skip to first unread message

ralfbat...@gmail.com

unread,
May 21, 2024, 7:59:32 AMMay 21
to WildFly
Dear experts, we are migrating our application from Wildfly 26.1.3 to 32.0.0.

We configured two rest endpoints with the required microprofile-config.properties, as per admin guide, each endpoint needs a separate path. This worked fine with Wildfly 26.1.3 but with Wildfly 32.0.0, we get this:
 
2024-05-21 13:31:44,336 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service org.wildfly.undertow.host.default-server.default-host./api/filetransfer: org.jboss.msc.service.StartException in service org.wildfly.undertow.host.default-server.default-host./api/filetransfer: java.util.NoSuchElementException
at org.wildfly.clu...@32.0.0.Final//org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:49)
at org.jb...@1.5.4.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1617)
at org.jb...@1.5.4.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1580)
at org.jb...@1.5.4.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1438)
at org.jbos...@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.NoSuchElementException
at java.base/java.util.ArrayDeque.removeFirst(ArrayDeque.java:362)
at java.base/java.util.ArrayDeque.pop(ArrayDeque.java:593)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.process(OpenApiDataObjectScanner.java:171)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.io.schema.SchemaFactory.otherTypeToSchema(SchemaFactory.java:700)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.io.schema.SchemaFactory.typeToSchema(SchemaFactory.java:523)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.mapParameterSchema(AbstractParameterProcessor.java:574)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.mapParameter(AbstractParameterProcessor.java:511)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.lambda$getParameters$15(AbstractParameterProcessor.java:424)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.getParameters(AbstractParameterProcessor.java:427)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.processOperationParameters(AbstractParameterProcessor.java:287)
at io.smallr...@3.10.0//io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor.process(AbstractParameterProcessor.java:249)
at io.smallr...@3.10.0//io.smallrye.openapi.jaxrs.JaxRsParameterProcessor.process(JaxRsParameterProcessor.java:82)
at io.smallr...@3.10.0//io.smallrye.openapi.jaxrs.JaxRsAnnotationScanner.getResourceParameters(JaxRsAnnotationScanner.java:522)
at io.smallr...@3.10.0//io.smallrye.openapi.jaxrs.JaxRsAnnotationScanner.processResourceMethod(JaxRsAnnotationScanner.java:439)
at io.smallr...@3.10.0//io.smallrye.openapi.jaxrs.JaxRsAnnotationScanner.lambda$processResourceMethods$1(JaxRsAnnotationScanner.java:282)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)


The content of the microprofile-config.properties is:
mp.openapi.extensions.enabled=true
mp.openapi.extensions.path=/api/filetransfer


Are there additional steps required to migrate?

Best Regards, Ralf

Paul Ferraro

unread,
May 21, 2024, 5:33:18 PMMay 21
to WildFly
This looks like a race condition.  smallrye-open-api was not initially designed to support multiple endpoints - as it relied on stateful static objects.
I filed https://issues.redhat.com/browse/WFLY-19355 and should have a fix shortly.

Paul Ferraro

unread,
May 21, 2024, 5:50:56 PMMay 21
to WildFly
Actually, disregard my previous message.  This exception is due to the mutable nature of the AnnotationScanner implementations - which WildFly is currently assuming to be stateless.

Paul Ferraro

unread,
May 22, 2024, 3:36:24 PMMay 22
to WildFly
This will be fixed in 32.0.1.Final: https://github.com/wildfly/wildfly/pull/17906

ralfbat...@gmail.com

unread,
May 23, 2024, 12:38:57 AMMay 23
to WildFly
Thank you very much!
Best Regards, Ralf

Reply all
Reply to author
Forward
0 new messages