java.util.NoSuchElementException: Source was empty

Spring JIRA | Brian Clozel | 4 months ago
  1. 0

    When using the {{WebClient}} with the following example and the server returns HTTP 401: {code} Mono<ResponseEntity<Map>> response = this.webClient                 .perform(peopleRequest().apply(httpBasic("rob","invalid")))                 .extract(response(Map.class)); {code} The client throws a {{NoSuchElementException}}: {code} java.util.NoSuchElementException: Source was empty     at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:179)     at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)     at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:762)     at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:520)     at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:500)     at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:493)     at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)     at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:155)     at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onComplete(FluxSubscribeOn.java:136)     at reactor.core.publisher.Operators.complete(Operators.java:182)     at reactor.ipc.netty.common.NettyChannelHandler.subscribe(NettyChannelHandler.java:537)     at reactor.core.publisher.FluxSource.subscribe(FluxSource.java:59)     at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:234)     at reactor.core.scheduler.ExecutorScheduler$ExecutorTrackedRunnable.run(ExecutorScheduler.java:136)     at io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)     at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)     at java.lang.Thread.run(Thread.java:745) {code}

    Spring JIRA | 4 months ago | Brian Clozel
    java.util.NoSuchElementException: Source was empty
  2. 0

    java.util.NoSuchElementException: empty sequence

    YouTrack | 7 years ago
    java.util.NoSuchElementException: empty sequence
  3. 0

    TimeoutException with Latest Build

    GitHub | 12 months ago | neilchaudhuri
    java.util.NoSuchElementException: queue empty
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.NoSuchElementException

      Source was empty

      at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete()
    2. reactor.core.publisher
      Operators.complete
      1. reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:179)
      2. reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
      3. reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:762)
      4. reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:520)
      5. reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:500)
      6. reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:493)
      7. reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
      8. reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:155)
      9. reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onComplete(FluxSubscribeOn.java:136)
      10. reactor.core.publisher.Operators.complete(Operators.java:182)
      10 frames
    3. reactor.ipc.netty
      NettyChannelHandler.subscribe
      1. reactor.ipc.netty.common.NettyChannelHandler.subscribe(NettyChannelHandler.java:537)
      1 frame
    4. reactor.core.publisher
      FluxSubscribeOn$SourceSubscribeTask.run
      1. reactor.core.publisher.FluxSource.subscribe(FluxSource.java:59)
      2. reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:234)
      2 frames
    5. reactor.core.scheduler
      ExecutorScheduler$ExecutorTrackedRunnable.run
      1. reactor.core.scheduler.ExecutorScheduler$ExecutorTrackedRunnable.run(ExecutorScheduler.java:136)
      1 frame
    6. Netty
      SingleThreadEventExecutor$5.run
      1. io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)
      2. io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
      3. io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)
      4. io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
      4 frames
    7. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame