How java scala mix?

1.i have java api service(DispositionService) and scala service
2 lazy val dispositionService: DispositionServiceScala = serviceClient.implement[DispositionService]
compile Error: Development\lagom\comparison-car\src\main\scala\tallsafe\comparison\car\impl\service\ComparisonCarServiceLoad.scala:56:76: type arguments [tallsafe.disposition.DispositionService] do not conform to macro method implement’s type parameter bounds [S <: com.lightbend.lagom.scaladsl.api.Service]
[error] lazy val dispositionService: DispositionService = serviceClient.implement[DispositionService] notwork


The clue is in the message: “do not conform to macro method implement’s type parameter bounds [S <: com.lightbend.lagom.scaladsl.api.Service]”

In order to use it with the macro serviceClient.implement, the passed trait must conform be an extension of com.lightbend.lagom.scaladsl.api.Service, which it is not because it’s a Java implementation.

Try to create a duplicate of this definition but then using the scaladsl. Then you can used it with the macro. You will need to keep the two versions (the java original and the scala copy) in sync as it’s not possible to consume a Java service from a Scala service using the generated client.

I hope this clarifies.

I’ve implemented my service early, but it’s too cumbersome