add next (see below) in the main method and import
sbt assembly (or your other step to build jar)
import scala.jdk.CollectionConverters._
val a = util.Arrays.asList(1,2,3,4,5)
val b = a.asScala.toList.map { x =>
x^2
}
log.info(s"Does it work?: $b")
Error in runtime: java.lang.NoSuchMethodError: 'scala.collection.mutable.Buffer scala.collection.convert.AsScalaConverters.asScala$(scala.collection.convert.AsScalaConverters, java.util.List)'
Please Note! While checking jar package you can find, that all the required libraries already included, for ex. scala.collection.mutable.Buffer and scala.collection.convert.AsScalaConverters already part of the jar and runtime. You can check jar package with command jar tf <file>. However it doesn't work when you build and run in Kinesis Flink application.
Steps to reproduce:
Error in runtime: java.lang.NoSuchMethodError: 'scala.collection.mutable.Buffer scala.collection.convert.AsScalaConverters.asScala$(scala.collection.convert.AsScalaConverters, java.util.List)'
Please Note! While checking jar package you can find, that all the required libraries already included, for ex.
scala.collection.mutable.Buffer
andscala.collection.convert.AsScalaConverters
already part of the jar and runtime. You can check jar package with commandjar tf <file>
. However it doesn't work when you build and run in Kinesis Flink application.