Questions tagged [playframework-2.5]

Play is based on a lightweight, stateless, web-friendly architecture and features predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

Play is based on a lightweight, stateless, web-friendly architecture and features predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

What's new in Play 2.5

Migration Guide

507 questions
19
votes
3 answers

Play 2.5.3: Cryptic error message: Exception caught in Netty java.lang.NoClassDefFoundError

[error] p.c.s.n.PlayRequestHandler - Exception caught in Netty java.lang.NoClassDefFoundError: Could not initialize class play.api.http.DefaultHttpErrorHandler$ at I get error message and my app doesn't start in dev…
Mike Pakhomov
  • 425
  • 6
  • 14
18
votes
1 answer

How do I perform an action on server startup in the Scala Play Framework?

I have a config file servers.conf in my conf/ directory that is read by my ServerController whenever the route /servers is hit. This isn't performant because it requires a re-read of the configuration file on each successive hit when the file won't…
erip
  • 13,935
  • 9
  • 51
  • 102
17
votes
3 answers

Warning message running Play 2.5.x

Whenever I run my application with activator run I get the following warning: "The system cannot find the file BIN_DIRECTORY\..\conf\sbtconfig.txt" What does this message mean? Should I create this file? The application works fine.
ps0604
  • 2,125
  • 16
  • 88
  • 233
17
votes
2 answers

Dependency injection with abstract class and object in Play Framework 2.5

I'm trying to migrate from Play 2.4 to 2.5 avoiding deprecated stuff. I had an abstract class Microservice from which I created some objects. Some functions of the Microservice class used play.api.libs.ws.WS to make HTTP requests and also…
Nick
  • 1,814
  • 1
  • 18
  • 37
14
votes
3 answers

How to test a Scala Play Framework websocket?

If I have a websocket like the following: def websocket: WebSocket = WebSocket.accept[String, String] { _ => ActorFlow.actorRef(out => LightWebSocketActor.props(out)) } For reference, this is the LightWebSocketActor: class…
11
votes
5 answers

Play 2.5.3: Using dependency injection to get configuration values

I'm trying to migrate a Playframework application from 2.4 to 2.5.3 and I have problems to get values from application.conf file: Before to get a value of from application.conf what I do…
9
votes
2 answers

WebSocket.acceptWithActor and @Inject() in the Actor (Play 2.5)

WebSocket.acceptWithActor instantiates a new Akka actor without making use of Guice. With Play 2.4, using the injector for my actor was still possible by importing play.api.Play.current. Snippet from ReactiveMongo documentation: import…
ideaboxer
  • 3,083
  • 6
  • 36
  • 57
9
votes
1 answer

Testing request with CSRF Token in Play framework 2.5 (Scala)

I'm stuck on a little problem with my functionnal testing. I have a Play! 2.5 scala project in which I added CSRF verification on some forms, the associated scala-test units test failed, as expected, with the error : java.lang.RuntimeException: No…
Argurth
  • 560
  • 5
  • 16
8
votes
5 answers

Play! Scala 2.5 : testing classes injecting cache leads to an error

I'm using for the first time the cache of Play! Scala 2.5. It works well except for the tests. My test still pass since I don't need the cache but I get this error (and a lot of others telling the same thing): Unable to provision, see the…
Simon
  • 4,844
  • 4
  • 32
  • 69
8
votes
1 answer

How to assemble an Akka Streams sink from multiple file writes?

I'm trying to integrate an akka streams based flow in to my Play 2.5 app. The idea is that you can stream in a photo, then have it written to disk as the raw file, a thumbnailed version and a watermarked version. I managed to get this working using…
Tompey
  • 334
  • 1
  • 7
8
votes
1 answer

Play.current is deprecated in play 2.5

I am currently using Play.current in the following way. import play.api.{Logger, Play} object ApplicationConfig { val app = Play.current def getConfInt(key: String): Option[Int] = { val result = app.configuration.getInt(key) result …
Scipion
  • 9,227
  • 7
  • 59
  • 120
8
votes
3 answers

How to refactor this code by using akka streams.

The idea is to keep the channel opened to use it later. In playframework 2.5.x the documentation says that you have to use akka streams but does not say anything how to achieve this example. Somebody can help me? import play.api.mvc._ import…
7
votes
1 answer

Akka version collision between Flink and Play 2.5

In our project we have a Flink (1.1.3) streaming job that reads from one kafka queue, performs a map function transformation and writes to another queue. This was working well until we introduced an outgoing REST request as part of the flow. To do…
7
votes
0 answers

Play framework 2.5.x: IllegalStateException: Attempted to call materialize() after the ActorMaterializer has been shut down

The intention of the Play server is to act as an intermediate service to another system, where the end-users access a small portion of functionality in a web browser on their smartphone. The service functions as supposed to when connected to the…
7
votes
2 answers

Play tests with database: "Too many connections"

To have a database available in scalatest with evolutions I use this extension of the default PlaySpec inspired by this SO question: trait ResetDbSpec extends PlaySpec with BeforeAndAfterAll { lazy val appBuilder = new GuiceApplicationBuilder() …
JulienD
  • 6,170
  • 8
  • 44
  • 72
1
2 3
33 34