1

In Ammonite, I execute the following codes... Trying to do an orderedMerge of two Flowables,

import $ivy.{
    `io.circe::circe-generic:0.13.0`                    ,
    `io.circe::circe-parser:0.13.0`                     ,
    `io.circe::circe-optics:0.13.0`                     ,
    `com.softwaremill.sttp::core:1.7.2`                 ,
    `org.scalaz::scalaz-core:7.2.27`                    ,
    `com.lihaoyi::requests:0.2.0`                       ,
    `io.get-coursier::coursier-core:2.0.0-RC4`          ,
    `io.lemonlabs::scala-uri:1.4.10`                    ,
    `net.liftweb::lift-json:3.4.0`                      ,
    `io.reactivex.rxjava3:rxjava:3.0.3`                 ,
    `com.github.akarnokd:rxjava3-extensions:3.0.0-RC7`
}

import io.lemonlabs.uri._
implicit val formats = net.liftweb.json.DefaultFormats
import net.liftweb.json.JsonAST._
import net.liftweb.json.Extraction._
import net.liftweb.json._
import io.reactivex.rxjava3.core._
import io.reactivex.rxjava3.functions._
import net.liftweb.json.JsonDSL._
import collection.JavaConverters._
import io.reactivex.rxjava3.subjects._
import scala.collection.mutable.HashMap
import io.reactivex.rxjava3.internal.functions.Functions
Flowables.orderedMerge(
    List(
        Flowable.just(3, 5),
        Flowable.just(2, 4, 6)
    ).toIterable.asJava, 
    Functions.naturalComparator[Int]()
    ).subscribe(i=>println(i))

But after printing 2, it throw exception:

java.lang.NoSuchMethodError: io.reactivex.rxjava3.internal.subscribers.InnerQueuedSubscriber.requestOne()V
  hu.akarnokd.rxjava3.operators.BasicMergeSubscription.drain(BasicMergeSubscription.java:268)
  hu.akarnokd.rxjava3.operators.BasicMergeSubscription.innerComplete(BasicMergeSubscription.java:161)
  io.reactivex.rxjava3.internal.subscribers.InnerQueuedSubscriber.onSubscribe(InnerQueuedSubscriber.java:69)
  io.reactivex.rxjava3.internal.operators.flowable.FlowableFromArray.subscribeActual(FlowableFromArray.java:39)
  io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15750)
  io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15696)
  hu.akarnokd.rxjava3.operators.BasicMergeSubscription.subscribe(BasicMergeSubscription.java:79)
  hu.akarnokd.rxjava3.operators.FlowableOrderedMerge.subscribeActual(FlowableOrderedMerge.java:94)
  io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15750)
  io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15686)
  io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15618)
  ammonite.$sess.cmd63$.<clinit>(cmd63.sc:1)

Could anyone help me with it? I have no any idea about it...

The weird part is, it could print the first ordered item, but not the following ones...

Anibal Yeh
  • 349
  • 1
  • 11

2 Answers2

2

rxjava3-extensions:3.0.0-RC7 is not compatible with rxjava:3.0.3. Release candidates don't provide strict compatibility guarantees.

Upgrade to rxjava3-extensions:3.0.0 or up.

For future reference NoSuchMethodError almost always indicates incompatible libraries. The unfound method in the exception message and the method at the top of the stacktrace are good indicators of which libraries are involved.

Jasper-M
  • 14,966
  • 2
  • 26
  • 37
0

The original developer of the library told me to use the release version library, not to use the RC7. Then everything go well now.

Thanks all of you!

om.subscribe(i=>println(i)) 
2
3
4
5
6
res22: io.reactivex.rxjava3.disposables.Disposable = CANCELLED
Anibal Yeh
  • 349
  • 1
  • 11