Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sakib Hadžiavdić
    @sake92
    @godenji check out my example with stone routes: https://github.com/sake92/playful-scala You get url construction for free! :) If thats what you need
    N.S. Cutler
    @godenji
    @sake92 looking for a stripped down Play, which I have yet to see actually implemented in such a way that standard routing actually works.
    @will_sargent_twitter I looked at slim-play, which itself depends on the PlayScala plugin. How do you mean, "but you have to manually enable it"?
    with PlayAkkaHttpServer and RoutesCompiler plugins enabled no routes files are generated. I'll experiment a bit more to see what's happening, not sure why it wouldn't work.
    grrr
    okay the ipad app is crap
    you have to add RoutesCompiler plugin
    gregs is the one i was thiking of
    N.S. Cutler
    @godenji
    @will_sargent_twitter thanks, that's more like it, maybe sticking routes file in src/main/resources is the missing piece.
    Dan Ellis
    @danellis
    Is play-grpc supposed to work with Scala 2.13 yet? I understood from the tickets that it is, but the play.grpc package doesn't seem to exist, so I can't import play.grpc.gen.scaladsl.PlayScalaClientCodeGenerator.
    Will Sargent
    @will_sargent_twitter
    @danellis dunno, maybe ask on the discourse website?
    Justin Reeves
    @justinallenreeves
    Is there an easy way to deserialize json case insensitively?
    Justin Reeves
    @justinallenreeves
    oof, this message is worse than that, it's json nested as a string in json, no wonder my deserializing straight to a case class structure is failing
    youexec-llc
    @youexec-llc

    Hello all,

    I am testing Play, am using Oracle Java 1.8. When I download the Play Java Starter example and enable Ebean with a single model, I get a:

    Unsupported class file major version 58

    Error. On my plugins.sbt I have:

    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.1")
    addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "6.0.0")

    and am using all the defaults from Play. This used to work before, but as of recently it does not work. I believe "guice" or "Ebean's injection" or a dependency has been compiled with Java 14. Also, when I place in the JavaOptions the following:

        javacOptions ++= Seq(
          "-source", "1.8", "-target", "1.8",
          ...

    The compiler breaks saying there is code compiled with Java 14. Does anyone else get this problem? So far I have tried different permutations of the Play Framework, Ebean, Scala, and other

    versions. I believe if you clear your Sbt and Gradle cache you will get the same error.
    Will Sargent
    @wsargent
    I think ebean may only work with jdk 11
    you may need to specify --release 11
    youexec-llc
    @youexec-llc
    I've used to have it work with Java 8, I have tested with Java 11 and newer and 14 (mayor version 58) and the same problem happens
    I think the latest version of Guice or the Ebean injector is injecting incorrectly, or an sbt library has been compiled with Java 14 erroneously -- not sure...
    Will Sargent
    @wsargent
    that sound about right
    anything on ebean.io?
    youexec-llc
    @youexec-llc
    I have one laptop with a setup that does work. When I got a new laptop with the exact setup -- the bug happened. I can only imagine the cache libraries of the old laptop is what caused everything to work
    Will Sargent
    @wsargent
    sbt can do that if it's compiling the compiler bridge for the first time and does it with the newest jdk
    do an rm -rf $HOME/.sbt (after saving stuff off)
    youexec-llc
    @youexec-llc
    Hm, I did that just now -- re-lauched the app and still get Unsupported class file major version 58
    Is there any other cache that might cause this?
    This is my "java -version" java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
    Will Sargent
    @wsargent
    your java version is 1.8, and it's trying to read jdk 14+ bytecode
    that's not going to work
    Dan Ellis
    @danellis
    Is it possible to get the underlying Akka HTTP request from a Play request?
    Will Sargent
    @wsargent
    err, I don't think so
    I think the model conversion calls the underlying request but does not expose it
    N.S. Cutler
    @godenji

    So, to setup a minimal play REST server (i.e. with no twirl, js routes, assets, etc. dependencies) this works:

    lazy val root =
      (project in file("."))
        .enablePlugins(PlayAkkaHttpServer)
        .enablePlugins(RoutesCompiler)

    and then copy conf/* to src/main/resources/

    finally, lean and mean Play!
    Eric Peters
    @er1c
    is there a good way to test filters, e.g. an anonymous route handler inside of a test?
    I want to make sure a TypedKey gets set properly
    Eric Peters
    @er1c
    ooh that looks promising
    :beer: for you, thanks
    Eric Peters
    @er1c
    any idea where that Ok def is suppose to be coming from?
    Yar
    @divijan
    @er1c see play.api.mvc.Results. IntelliJ IDEA makes answering this kind of questions a breeze
    Eric Peters
    @er1c
    I thought so but it wasn't giving me a good hint
    Justin Reeves
    @justinallenreeves
    @er1c if you're using IDEA, Command or Ctrl click into a Symbol to jump to it's definition
    NKM
    @nkmittal
    Two related questions:
    1. I am using AWS SDK Java version 1 for S3 operations (in my Play 2.6 Scala app). I get this warning (code works just fine):
      [warn] c.a.h.a.u.ApacheUtils - NoSuchMethodException was thrown when disabling normalizeUri. This indicates you are using an old version (< 4.5.8) of Apache http client. It is recommended to use http client version >= 4.5.9 to avoid the breaking change introduced in apache client 4.5.7 and the latency in exception handling. See https://github.com/aws/aws-sdk-java/issues/1919 for more information
      I tried multiple versions > 4.5.9 but does not go away.
    2. If I upgrade to version 2 of AWS SDK Java then I get runtime error:
      Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:233) at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303) at java.lang.invoke.CallSite.makeSite(CallSite.java:302) at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307) at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297) at software.amazon.awssdk.http.apache.ApacheHttpClient.transformHeaders(ApacheHttpClient.java:289) at software.amazon.awssdk.http.apache.ApacheHttpClient.createResponse(ApacheHttpClient.java:274) at software.amazon.awssdk.http.apache.ApacheHttpClient.execute(ApacheHttpClient.java:254) at software.amazon.awssdk.http.apache.ApacheHttpClient.access$500(ApacheHttpClient.java:106) at software.amazon.awssdk.http.apache.ApacheHttpClient$1.call(ApacheHttpClient.java:232)
      Various solutions point to using a particular ApacheHttpClient dependency. I tried many versions but no help.
    NKM
    @nkmittal
    I suspect the apache.http.* libraries which are installed with Play 2.6 are not getting overridden with explicit dependency added. But not sure of this assumption.