Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16868

PathVariable with nested router function throws IllegalArgumentException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.7, 5.1 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      Making GET request to endpoint which takes parameter as path variable throws IllegalStateException with Spring Boot 2.0.2.RELEASE version. But when I change version to Spring Boot 2.0.1.RELEASE, it works. I attached my sample code and screenshots. Also you can find the exception stack trace below :

      java.lang.IllegalArgumentException: No path variable with name "id" available
      	at org.springframework.web.reactive.function.server.ServerRequest.pathVariable(ServerRequest.java:225) ~[spring-webflux-5.0.6.RELEASE.jar:5.0.6.RELEASE]
      	at com.emre.reactivedemo.handler.UserHandler.getUser(UserHandler.java:36) ~[classes/:na]
      	at org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:61) ~[spring-webflux-5.0.6.RELEASE.jar:5.0.6.RELEASE]
      	at org.springframework.web.reactive.DispatcherHandler.invokeHandler(DispatcherHandler.java:168) ~[spring-webflux-5.0.6.RELEASE.jar:5.0.6.RELEASE]
      	at org.springframework.web.reactive.DispatcherHandler.lambda$handle$1(DispatcherHandler.java:160) ~[spring-webflux-5.0.6.RELEASE.jar:5.0.6.RELEASE]
      	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:271) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:803) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1637) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1451) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1325) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:75) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:78) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators.complete(Operators.java:125) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:45) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:75) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:78) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators.complete(Operators.java:125) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:45) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:75) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Operators.complete(Operators.java:125) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:45) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoMap.subscribe(MonoMap.java:55) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:418) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:210) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:128) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:61) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:167) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:70) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61) ~[reactor-core-3.1.7.RELEASE.jar:3.1.7.RELEASE]
      	at reactor.ipc.netty.channel.ChannelOperations.applyHandler(ChannelOperations.java:380) ~[reactor-netty-0.7.7.RELEASE.jar:0.7.7.RELEASE]
      	at reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart(HttpServerOperations.java:397) ~[reactor-netty-0.7.7.RELEASE.jar:0.7.7.RELEASE]
      	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.24.Final.jar:4.1.24.Final]
      	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.24.Final.jar:4.1.24.Final]
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[netty-transport-4.1.24.Final.jar:4.1.24.Final]
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.24.Final.jar:4.1.24.Final]
      	at java.base/java.lang.Thread.run(Thread.java:844) ~[na:na]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arjen.poutsma Arjen Poutsma
                Reporter:
                _emrekarabacak_ Emre Karabacak
                Last updater:
                St├ęphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 weeks, 3 days ago