play.sbt.PlayExceptions$CompilationException

Compilation error[method thenApply in interface java.util.concurrent.CompletionStage<T> cannot be applied to given types; required: java.util.function.Function<? super com.fasterxml.jackson.databind.JsonNode,? extends U> found: (res)->{ S[...]s); } reason: cannot infer type-variable(s) U (argument mismatch; bad return type in lambda expression missing return value)]

Samebug tips2

Import these into your controller:

import play.api.Play.current import play.api.i18n.Messages.Implicits._


BugmateHits had no serialization method.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web50

  • via Stack Overflow by raju
    , 9 months ago
    Compilation error[method thenApply in interface java.util.concurrent.CompletionStage<T> cannot be applied to given types; required: java.util.function.Function<? super com.fasterxml.jackson.databind.JsonNode,? extends U> found: (res)->{ S[...]s); } reason: cannot infer type-variable(s) U (argument mismatch; bad return type in lambda expression missing return value)]
  • via Stack Overflow by jkratz55
    , 11 months ago
    Compilation error[no suitable method found for select(models.QMember) method com.querydsl.jpa.impl.JPAQuery.<U>select(com.querydsl.core.types.Expression<U>) is not applicable (cannot infer type-variable(s) U (argument mismatch; models.QMember
  • Compilation error[type mismatch; found : String required: echo.yaml.PostYear (which expands to) Option[String]]
  • Stack trace

    • play.sbt.PlayExceptions$CompilationException: Compilation error[method thenApply in interface java.util.concurrent.CompletionStage<T> cannot be applied to given types; required: java.util.function.Function<? super com.fasterxml.jackson.databind.JsonNode,? extends U> found: (res)->{ S[...]s); } reason: cannot infer type-variable(s) U (argument mismatch; bad return type in lambda expression missing return value)] at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) at scala.Option.map(Option.scala:145) at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:49) at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44) at scala.Option.map(Option.scala:145) at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44) at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40) at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17) at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 1 week ago
    Once, 1 month ago
    28 times, 1 month ago
    172 times, 2 months ago
    Once, 2 months ago
    14 more bugmates