Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot and OpenAPI not compatible #169

Open
khorn-infomedia opened this issue Jan 13, 2025 · 6 comments
Open

Spring Boot and OpenAPI not compatible #169

khorn-infomedia opened this issue Jan 13, 2025 · 6 comments

Comments

@khorn-infomedia
Copy link

The POM parent specifies spring boot 3.3.5

The gateway service has openapi version 2.8.2, but these require spring boot 3.4
The gateway does not start, Illegal State Exception. This is usually caused by imcompatable libraries.

changing down the openapi version to 2.6.0 works...

Maybe update the parent POM to latest spring boot version ?

Kim

@khorn-infomedia khorn-infomedia changed the title Spring Bott and OpenAPI not compatible Spring Boot and OpenAPI not compatible Jan 13, 2025
@khorn-infomedia
Copy link
Author

Also define the openapi version in the parent POM as its used by 4 services.

<spring-openai.version>2.6.0</spring-openai.version>

@khorn-infomedia
Copy link
Author

Now the Gateway server starts, using 2.6.0, but but when queried, http://localhost:8060/employee/

it dies and get this error:
2025-01-13 14:52:07 java.lang.NoSuchMethodError: 'java.util.Set org.springframework.http.HttpHeaders.headerSet()'
2025-01-13 14:52:07 at org.springframework.cloud.gateway.filter.headers.ForwardedHeadersFilter.filter(ForwardedHeadersFilter.java:99)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.filter.headers.HttpHeadersFilter.filter(HttpHeadersFilter.java:38)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.filter.headers.HttpHeadersFilter.filterRequest(HttpHeadersFilter.java:28)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.filter.NettyRoutingFilter.filter(NettyRoutingFilter.java:125)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.handler.FilteringWebHandler$GatewayFilterAdapter.filter(FilteringWebHandler.java:147)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.filter.OrderedGatewayFilter.filter(OrderedGatewayFilter.java:44)
2025-01-13 14:52:07 at org.springframework.cloud.gateway.handler.FilteringWebHandler$DefaultGatewayFilterChain.lambda$filter$0(FilteringWebHandler.java:127)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:45)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:241)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204)
2025-01-13 14:52:07 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.onComplete(MonoNext.java:102)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:83)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:98)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:44)
2025-01-13 14:52:07 at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:453)
2025-01-13 14:52:07 at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:724)
2025-01-13 14:52:07 at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.onNext(FluxFlattenIterable.java:256)
2025-01-13 14:52:07 at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:294)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:188)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:237)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89)
2025-01-13 14:52:07 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onComplete(FluxDematerialize.java:121)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:91)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:44)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.fastPath(FluxIterable.java:402)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:291)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.request(FluxDematerialize.java:127)
2025-01-13 14:52:07 at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72)
2025-01-13 14:52:07 at reactor.core.publisher.FluxPeek$PeekSubscriber.onSubscribe(FluxPeek.java:171)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onSubscribe(FluxDematerialize.java:77)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$BaseFluxToMonoOperator.completePossiblyEmpty(Operators.java:2097)
2025-01-13 14:52:07 at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:118)
2025-01-13 14:52:07 at reactor.core.publisher.DrainUtils.postCompleteDrain(DrainUtils.java:132)
2025-01-13 14:52:07 at reactor.core.publisher.DrainUtils.postComplete(DrainUtils.java:187)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMaterialize$MaterializeSubscriber.onComplete(FluxMaterialize.java:141)
2025-01-13 14:52:07 at reactor.core.publisher.FluxLimitRequest$FluxLimitRequestSubscriber.onNext(FluxLimitRequest.java:104)
2025-01-13 14:52:07 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
2025-01-13 14:52:07 at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
2025-01-13 14:52:07 at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onNext(FluxTimeout.java:181)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$BaseFluxToMonoOperator.completePossiblyEmpty(Operators.java:2097)
2025-01-13 14:52:07 at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:118)
2025-01-13 14:52:07 at org.springframework.cloud.commons.publisher.FluxFirstNonEmptyEmitting$FirstNonEmptyEmittingSubscriber.onComplete(FluxFirstNonEmptyEmitting.java:325)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.fastPath(FluxIterable.java:424)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:291)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:164)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$DeferredSubscription.set(Operators.java:1780)
2025-01-13 14:52:07 at org.springframework.cloud.commons.publisher.FluxFirstNonEmptyEmitting$FirstNonEmptyEmittingSubscriber.onSubscribe(FluxFirstNonEmptyEmitting.java:297)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:92)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)
2025-01-13 14:52:07 at reactor.core.publisher.Flux.subscribe(Flux.java:8848)
2025-01-13 14:52:07 at org.springframework.cloud.commons.publisher.FluxFirstNonEmptyEmitting$RaceCoordinator.subscribe(FluxFirstNonEmptyEmitting.java:203)
2025-01-13 14:52:07 at org.springframework.cloud.commons.publisher.FluxFirstNonEmptyEmitting.subscribe(FluxFirstNonEmptyEmitting.java:128)
2025-01-13 14:52:07 at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:68)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)
2025-01-13 14:52:07 at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:68)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82)
2025-01-13 14:52:07 at reactor.core.publisher.Operators.complete(Operators.java:137)
2025-01-13 14:52:07 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46)
2025-01-13 14:52:07 at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:68)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165)
2025-01-13 14:52:07 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
2025-01-13 14:52:07 at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.innerNext(FluxConcatMapNoPrefetch.java:259)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:865)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
2025-01-13 14:52:07 at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.innerNext(FluxConcatMapNoPrefetch.java:259)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:865)
2025-01-13 14:52:07 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
2025-01-13 14:52:07 at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.onNext(MonoFilterWhen.java:136)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.request(MonoFilterWhen.java:183)
2025-01-13 14:52:07 at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.request(MonoPeekTerminal.java:139)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2367)
2025-01-13 14:52:07 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onSubscribe(FluxOnErrorResume.java:74)
2025-01-13 14:52:07 at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onSubscribe(MonoPeekTerminal.java:152)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.onSubscribe(MonoFilterWhen.java:100)
2025-01-13 14:52:07 at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onNext(FluxConcatMapNoPrefetch.java:207)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:98)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:44)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:335)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:294)
2025-01-13 14:52:07 at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.request(FluxDematerialize.java:127)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.innerComplete(FluxConcatMapNoPrefetch.java:275)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onComplete(FluxConcatMap.java:889)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2231)
2025-01-13 14:52:07 at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.onNext(MonoFilterWhen.java:141)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571)
2025-01-13 14:52:07 at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.request(MonoFilterWhen.java:183)
2025-01-13 14:52:07 at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.request(MonoPeekTerminal.java:139)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2331)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2331)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.request(FluxConcatMapNoPrefetch.java:339)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:164)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:164)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2331)
2025-01-13 14:52:07 at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:164)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2331)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.request(FluxConcatMapNoPrefetch.java:339)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2367)
2025-01-13 14:52:07 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2241)
2025-01-13 14:52:07 at reactor.core.publisher.MonoNext$NextSubscriber.onSubscribe(MonoNext.java:70)
2025-01-13 14:52:07 at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onSubscribe(FluxConcatMapNoPrefetch.java:164)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201)
2025-01-13 14:52:07 at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
2025-01-13 14:52:07 at reactor.core.publisher.Mono.subscribe(Mono.java:4576)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265)
2025-01-13 14:52:07 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
2025-01-13 14:52:07 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
2025-01-13 14:52:07 at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55)
2025-01-13 14:52:07 at reactor.netty.http.server.HttpServer$HttpServerHandle.onStateChange(HttpServer.java:1176)
2025-01-13 14:52:07 at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:716)
2025-01-13 14:52:07 at reactor.netty.transport.ServerTransport$ChildObserver.onStateChange(ServerTransport.java:481)
2025-01-13 14:52:07 at reactor.netty.http.server.HttpServerOperations.handleDefaultHttpRequest(HttpServerOperations.java:834)
2025-01-13 14:52:07 at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:779)
2025-01-13 14:52:07 at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:115)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2025-01-13 14:52:07 at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:262)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2025-01-13 14:52:07 at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
2025-01-13 14:52:07 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
2025-01-13 14:52:07 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333)
2025-01-13 14:52:07 at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:455)
2025-01-13 14:52:07 at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
2025-01-13 14:52:07 at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2025-01-13 14:52:07 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
2025-01-13 14:52:07 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-01-13 14:52:07 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
2025-01-13 14:52:07 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799)
2025-01-13 14:52:07 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
2025-01-13 14:52:07 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
2025-01-13 14:52:07 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2025-01-13 14:52:07 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2025-01-13 14:52:07 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2025-01-13 14:52:07 at java.base/java.lang.Thread.run(Unknown Source)

@khorn-infomedia
Copy link
Author

I then trie upgrading to Spring boot 3.4

    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.1</version>

and

    <spring-cloud.version>2024.0.0</spring-cloud.version>
    <spring-openai.version>2.8.2</spring-openai.version>

The code all builds , the business services work but the Gateway now crashes, on start, with this error:

gateway-service-1 | 2025-01-13 05:50:48 [,] - WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apis' defined in pl.piomin.services.gateway.GatewayApplication: Unsatisfied dependency expressed through method 'apis' parameter 1: No qualifying bean of type 'org.springdoc.core.properties.SwaggerUiConfigParameters' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
gateway-service-1 | 2025-01-13 05:50:48 [,] - INFO
gateway-service-1 |
gateway-service-1 | Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
gateway-service-1 | 2025-01-13 05:50:48 [,] -ERROR
gateway-service-1 |
gateway-service-1 | ***************************
gateway-service-1 | APPLICATION FAILED TO START
gateway-service-1 | ***************************
gateway-service-1 |
gateway-service-1 | Description:
gateway-service-1 |
gateway-service-1 | Parameter 1 of method apis in pl.piomin.services.gateway.GatewayApplication required a bean of type 'org.springdoc.core.properties.SwaggerUiConfigParameters' that could not be found.
gateway-service-1 |
gateway-service-1 |
gateway-service-1 | Action:
gateway-service-1 |
gateway-service-1 | Consider defining a bean of type 'org.springdoc.core.properties.SwaggerUiConfigParameters' in your configuration.
gateway-service-1 |

@khorn-infomedia
Copy link
Author

All Fixed.

The above is fixed with the new code for GatewayApplication.java, below, with the very latest Spring boot and OpenAPI 2.8.3
The issue is the SwaggerUiConfigProperties Vs SwaggerUiConfigParameters

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springdoc.core.properties.AbstractSwaggerUiConfigProperties.SwaggerUrl;
import org.springdoc.core.properties.SwaggerUiConfigProperties;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.RouteDefinitionLocator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static org.springdoc.core.utils.Constants.DEFAULT_API_DOCS_URL;

@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {

private static final Logger LOGGER = LoggerFactory.getLogger(GatewayApplication.class);

public static void main(String[] args) {
	SpringApplication.run(GatewayApplication.class, args);
}

@Bean
@Lazy(false)
public Set<SwaggerUrl> apis(RouteDefinitionLocator locator, SwaggerUiConfigProperties swaggerUiConfigProperties) {
	Set<SwaggerUrl> urls = new HashSet<>();
	List<RouteDefinition> definitions = locator.getRouteDefinitions().collectList().block();
	definitions.stream().filter(routeDefinition -> routeDefinition.getId().matches(".*-service")).forEach(routeDefinition -> {
		String name = routeDefinition.getId().replaceAll("-service", "");
		SwaggerUrl swaggerUrl = new SwaggerUrl(name, DEFAULT_API_DOCS_URL+"/" + name, null);
		urls.add(swaggerUrl);
	});
	swaggerUiConfigProperties.setUrls(urls);
	return urls;
}

}

@piomin
Copy link
Owner

piomin commented Jan 15, 2025

Thanks for that issue. Could you kindly propose a PR for that?

@khorn-infomedia
Copy link
Author

Done, see Boot 3.4.1 #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants