Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Will Sargent
    @wsargent
    I had to go through this with akka-http
    akka streams
    jxtps
    @jxtps
    Thanks for the links! I'm not really seeing a great path forward based on them though? I guess I have to create a custom HttpEntity that wraps the one returned by the action and then do some FP-magic with the original dataStream. Maybe watchTermination?
    Will Sargent
    @wsargent
    the data content is a Source
    so iirc I think you want a sink onComplete
    Eric Peters
    @er1c
    @wsargent FYI found out that you can inject addToken: CSRFAddToken, and then have def login: Action[CredentialsObject] = addToken(Action.async(parse.json[CredentialsObject]) { request => directLoginHandler.handle(request) }) for adding a token on a + nocsrf route
    Will Sargent
    @wsargent
    oh cool
    jxtps
    @jxtps
    Don't know how to hook a sink into that flow? I tried with watchTermination, and it did trigger at the end, but it somehow made my 100ms action take 1 second, so counterproductive.
    You mean I need to do something like dataSource.toMat(myTimingSink)(Keep.both).run() and then dup the HttpEntity giving it the returned source?
    Will Sargent
    @wsargent
    or runWith().onComplete
    I know its a complete thing
    need more ☕️
    jxtps
    @jxtps
    Yeah, the streams stuff works fine as long as you can interact with it on the Ok.chunked(...) level, but as soon as you need to go outside of the lines it's... well... tricky? It's a bit like switching from infix to postfix notation - once you're used to it I'm sure it's fine, but if it's not your bread-and-butter then there's a wall of incomprehensibility and the tradeoff for scaling it vs just not doing it heavily favors the latter ;)
    Anyway, thanks for the pointers!
    AlexXmartlabs
    @AlexXmartlabs
    Hi everybody, I am looking for help.
    We are using Scala 2.12.7 and added sbt-jshint
    addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.6")
    And I am getting a "unresolved dependency" error:
    remote: [warn] ::::::::::::::::::::::::::::::::::::::::::::::
    remote: [warn] :: UNRESOLVED DEPENDENCIES ::
    remote: [warn] ::::::::::::::::::::::::::::::::::::::::::::::
    remote: [warn] :: com.typesafe.sbt#sbt-jshint;1.0.6: not found
    remote: [warn] ::::::::::::::::::::::::::::::::::::::::::::::
    remote: [warn]
    remote: [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
    remote: [warn] com.typesafe.sbt:sbt-jshint:1.0.6 (scalaVersion=2.12, sbtVersion=1.0)
    remote: [warn]
    remote: [warn] Note: Unresolved dependencies path:
    remote: [warn] com.typesafe.sbt:sbt-jshint:1.0.6 (scalaVersion=2.12, sbtVersion=1.0) (/tmp/scala_buildpack_build_dir/project/plugins.sbt#L10-11)
    remote: [warn] +- default:scala_buildpack_build_dir-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
    Error: [error] sbt.librarymanagement.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-jshint;1.0.6: not found
    Error: [error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
    Error: [error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
    Error: [error] at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
    Error: [error] at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
    Error: [error] at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt
    KaTeX parse error: Can't use function '$' in math mode at position 7: action$̲1(Ivy.scala:70)…: action$1(Ivy.scala:70)        
    Error:         [error]     at sbt.internal.librarymanagement.IvySbt
    anon$3.call(Ivy.scala:77)
    Error: [error] at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
    Error: [error] at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock
    KaTeX parse error: Can't use function '$' in math mode at position 19: …hChannelRetries$̲1(Locks.scala:8…: withChannelRetries$1(Locks.scala:80)        
    Error:         [error]     at xsbt.boot.Locks$GlobalLock
    anonfun$withFileLock$1.apply(Locks.scala:99)
    Error: [error] at xsbt.boot.Using$.withResource(Using.scala:10)
    Error: [error] at xsbt.boot.Using$.apply(Using.scala:9)
    Error: [error] at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
    Error: [error] at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
    Error: [error] at xsbt.boot.Locks$.apply0(Locks.scala:31)
    Error: [error] at xsbt.boot.Locks$.apply(Locks.scala:28)
    Error: [error] at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
    Error: [error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
    Error: [error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
    Error: [error] at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:238)
    Error: [error] at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193)
    Error: [error] at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
    Error: [error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
    Error: [error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:45)
    Error: [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
    Error: [error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
    Error: [error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.
    Any idea what could be happening? I know this repo was migrated and I am able to found it on
    https://scala.jfrog.io/ui/repos/tree/General/sbt-plugin-releases%2Fcom.typesafe.sbt%2Fsbt-jshint
    So, I am not sure where the problem could be..
    I will appreciate any kind of help here. Thanks!
    ctoomey
    @ctoomey
    @wsargent FYI the issue I reported above seems to have been fixed by playframework/playframework@620159b , which I found when trying to reproduce the bug w/ Play 2.7.9 and being unable. :-)
    Will Sargent
    @wsargent
    good
    Răzvan Rotaru
    @roti
    does anyone use play with spring instead of guice?
    Will Sargent
    @wsargent
    its possible but not common
    AlexXmartlabs
    @AlexXmartlabs
    Make it work, by using resolvers += Resolver.sbtPluginRepo("releases") instead of type safe ones ...
    jxtps
    @jxtps
    I've run into a very weird new exception on one of my sites. It came out of nowhere (= has never happened before, I made no change that has any apparent connection to it), but now it keeps happening:
    Stack trace:
     java.lang.IllegalStateException: Sink.asPublisher(fanout = false) only supports one subscriber (which is allowed, see reactive-streams specification, rule 1.12)
     java.lang.IllegalStateException: Sink.asPublisher(fanout = false) only supports one subscriber (which is allowed, see reactive-streams specification, rule 1.12)
      akka.stream.impl.ReactiveStreamsCompliance$.rejectAdditionalSubscriber(ReactiveStreamsCompliance.scala:62)
      akka.stream.impl.VirtualPublisher.rec$6(StreamLayout.scala:479)
      akka.stream.impl.VirtualPublisher.subscribe(StreamLayout.scala:482)
      akka.stream.impl.fusing.ActorGraphInterpreter$BatchingActorInputBoundary.preStart(ActorGraphInterpreter.scala:135)
      akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:306)
      akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:594)
      akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:702)
      akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:751)
      akka.actor.Actor.aroundPreStart(Actor.scala:548)
      akka.actor.Actor.aroundPreStart$(Actor.scala:548)
      akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:691)
      akka.actor.ActorCell.create(ActorCell.scala:641)
      akka.actor.ActorCell.invokeAll$1(ActorCell.scala:513)
      akka.actor.ActorCell.systemInvoke(ActorCell.scala:535)
      akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:295)
      akka.dispatch.Mailbox.run(Mailbox.scala:230)
      akka.dispatch.Mailbox.exec(Mailbox.scala:243)
      java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
      java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
      java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
      java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
      java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
    The stack trace unfortunately doesn't really give me anything to go on - I have no idea which actor this happened in. Any suggestions for how to approach debugging this?
    jxtps
    @jxtps
    This is coming in through onServerError. There's no rhyme or reason to the URIs it happens for - it seems random. Could be a race condition? I raised the autoscaling CPU load target shortly before it started happening. But that's not a very satisfactory explanation, as it would point to a hidden weakness and I'd prefer to figure that out rather than "just" lower the CPU target back down.
    Will Sargent
    @wsargent
    you have anadditional subscruber but it doenst tell you where
    that's where the interop is, you have an extra subscribe somewhere
    jxtps
    @jxtps
    I don't subscribe to anything anywhere from what I can tell / recall, and certainly haven't added any subscriptions recently?! (I abandoned the request timing effort, so that's not it)
    A global whole-word, case-sensitive search for "subscribe" across my entire project has a single hit, inside a text string...
    (based on the doc you linked to I'm assuming the subscribe call would be along the lines of myPublisher.subscribe())
    Joobjoob
    @maplesyrup_gitlab
    @wsargent Hey, I checked out Actions as you mentioned, but from what I saw, it looks like controllers need to opt in to using the Action. I'm looking for a way to access the body on all requests without having to coordinate with controllers and prior to any deserialization happens. I can see what I need in the debugger (requestHeader.target.request has an entity), but am struggling to find the appropriate way to access it. Any suggestions?
    ErVito
    @ErVito

    Hi all,

    sorry for the trivial question...
    I have discovered, as others at the first steps in web application development and play, that opening my app in two different tabs of my browser and using one to do some operations and the other to do something else (with the app), when i refresh one tab the session "resets" to the session of the other tab (seems that the session is "shared" from the tabs).
    Googling a bit about this I haven't found much more and for this reason I need some references to clarify myself how session/cookies works (in general and in play, I need a sort of introduction to cookie/session handling).
    Do you have some useful links to start from?

    Anyway, looking around I've already found a solution: using a session-id in the URL I can uniquely link an user flow to some session data (stored on server side).
    Are there any other solutions to distinguish two distinct user flows on two tabs of the same browser?

    Thank you very much for each useful advice.

    Sakib Hadžiavdić
    @sake92
    Nikitha963
    @Nikitha963
    I am getting the above error while running sbt run

    and in frotend http://localhost:9000/ I am getting as :

    Configuration error
    application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties

    Nikitha963
    @Nikitha963
    Hi Team,
    play.api.Configuration
    KaTeX parse error: Can't use function '$' in math mode at position 5: anon$̲1: Configuratio…: anon$1: Configuration error[application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties]
                at play.api.Configuration$.configError(Configuration.scala:158)
                at play.api.Configuration$.load(Configuration.scala:104)
                at play.api.Configuration$.load(Configuration.scala:112)
            at play.api.ApplicationLoader$Context$.create(ApplicationLoader.scala:115)
            at play.core.server.DevServerStart
    anon$1.$anonfun$reload$3(DevServerStart.scala:173)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
    at play.core.server.DevServerStart
    KaTeX parse error: Can't use function '$' in math mode at position 5: anon$̲1.reload(DevSer…: anon$1.reload(DevServerStart.scala:168)
            at play.core.server.DevServerStart
    anon$1.get(DevServerStart.scala:127)
    at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:253)
    at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:149)
    Caused by: com.typesafe.config.ConfigException$IO: application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:236)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:979)
    at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:36)
    at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:473)
    at play.api.Configuration$.$anonfun$load$5(Configuration.scala:76)
    at scala.Option.getOrElse(Option.scala:138)
    at play.api.Configuration$.load(Configuration.scala:72)
    at play.api.Configuration$.load(Configuration.scala:112)
    at play.api.ApplicationLoader$Context$.create(ApplicationLoader.scala:115)
    Caused by: com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.conf
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:188)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
    at com.typesafe.config.impl.Parseable.parse(Parseable.java:152)
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:185)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:979)
    at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:36)
    at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:473)
    at play.api.Configuration$.$anonfun$load$5(Configuration.scala:76)
    at scala.Option.getOrElse(Option.scala:138)
    Caused by: java.io.IOException: resource not found on classpath: application.conf
    at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:735)
    at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:710)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
    at com.typesafe.config.impl.Parseable.parse(Parseable.java:152)
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:185)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:979)
    Prasad Mokkapati
    @pmokkapati
    I am using AWS elb have a mobile.pm2c.net ssl certificate but play seems to be using a self signed certificate. How do I change it in conf file.
    Using generated key with self signed certificate for HTTPS. This should NOT be used in production.
    Gaël Jourdan-Weil
    @gaeljw
    Hi folks,
    I opened a question on SO about being able to "detect" a Source failure at startup => https://stackoverflow.com/questions/67467565/play-framework-akka-streams-intercept-errors-at-source-startup
    I was wondering if anyone here would have any idea on the subject. Any help appreciated, thanks :)
    Nikitha963
    @Nikitha963
    Hi Team,

    Hi Team,

    I have stuck while executing sbt run , getting as resource not found on classpath error as below :
    I migrated play 2.2.6 to 2.7.0 ,scala 2.10.3 to 2.12.3 and sbt from 0.13.0 to 1.3.0 versions . please help me in fixing this issue :

    [error] application -

    ! @7jkchiof4 - Internal server error, for (GET) [/] ->

    play.api.Configuration

    KaTeX parse error: Can't use function '$' in math mode at position 5: anon$̲1: Configuratio…: anon$1: Configuration error[application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties]
            at play.api.Configuration$.configError(Configuration.scala:158)
            at play.api.Configuration$.load(Configuration.scala:104)
            at play.api.Configuration$.load(Configuration.scala:112)
        at play.api.ApplicationLoader$Context$.create(ApplicationLoader.scala:115)
        at play.core.server.DevServerStart
    anon$1.$anonfun$reload$3(DevServerStart.scala:173)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
    at play.core.server.DevServerStart
    KaTeX parse error: Can't use function '$' in math mode at position 5: anon$̲1.reload(DevSer…: anon$1.reload(DevServerStart.scala:168)
        at play.core.server.DevServerStart
    anon$1.get(DevServerStart.scala:127)
    at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:253)
    at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:149)
    Caused by: com.typesafe.config.ConfigException$IO: application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:236)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:979)
    at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:36)
    at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:473)
    at play.api.Configuration$.$anonfun$load$5(Configuration.scala:76)
    at scala.Option.getOrElse(Option.scala:138)
    at play.api.Configuration$.load(Configuration.scala:72)
    at play.api.Configuration$.load(Configuration.scala:112)
    at play.api.ApplicationLoader$Context$.create(ApplicationLoader.scala:115)
    Caused by: com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.conf
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:188)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
    at com.typesafe.config.impl.Parseable.parse(Parseable.java:152)
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:185)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.ConfigFactory.parseResourcesAnySyntax(ConfigFactory.java:979)
    at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:36)
    at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:473)
    at play.api.Configuration$.$anonfun$load$5(Configuration.scala:76)
    at scala.Option.getOrElse(Option.scala:138)
    Caused by: java.io.IOException: resource not found on classpath: application.conf
    at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:735)
    at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:710)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
    at com.typesafe.config.impl.Parseable.parse(Parseable.java:152)
    at com.typesafe.config.impl.SimpleIncluder.fromBasename(SimpleIncluder.java:185)
    at com.typesafe.config.impl.ConfigImpl.parseResourcesAnySyntax(ConfigImpl.java:132)
    at com.typesafe.config.Config

    Nikitha963
    @Nikitha963

    Hi Team,

    application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties

    6 replies
    Nikitha963
    @Nikitha963

    Hi Team,

    Caused by: java.lang.RuntimeException: java.io.IOException: resource not found on classpath: conf/application.conf #6507 I got this error so I understood that application.conf file is missing so added application.conf an empty file in conf directory in some project root directory . Actually my project has application.conf file under : modules/core/conf folder.

    After adding a conf file under root directory I am getting the below error:

    http://localhost:9000 - Action Not Found
    For request 'GET /'

    These routes have been tried, in this order:

    In sbt console :

    [warn] p.db.DBModule - Configuration not found for database: No configuration setting found for key 'db'
    [info] p.a.h.EnabledFilters - Enabled Filters (see https://www.playframework.com/documentation/latest/Filters):

    play.filters.csrf.CSRFFilter
    play.filters.headers.SecurityHeadersFilter
    play.filters.hosts.AllowedHostsFilter

    [info] play.api.Play - Application started (Dev) (no global state)