17,271 questions
2
votes
2
answers
128
views
Read JSON in UpperCamelCase (Pascal case) using Jsonx.formatCaseClass from play-json-extensions
I am working on some code which reads from an external REST API that uses UpperCamelCase (a.k.a. Pascal case) for the keys in its JSON responses:
{"FirstKey": "a", "SecondKey&...
0
votes
1
answer
75
views
Default URL redirection after login
When logging in with a FormClient how can I change the default URL I get redirected to ?
It seems to be "/" by default. Is this the same thing as "callback URL" ?
0
votes
0
answers
37
views
Play Framework 2.9 upgrade: getMinKeyLength method not found due to io.jsonwebtoken version conflict
I am upgrading my Play Framework project from version 2.8 to 2.9. As part of this, I upgraded my Java version to OpenJDK 17 and updated my build.sbt and plugins.sbt files accordingly.
The project ...
0
votes
1
answer
107
views
Migration to playframework 3.0 - Error while emitting Routes.scala
I try to migrate old playframework 2.8 to 3.0.8 (jdk 11 -> jdk 21).
And when try to compile: ./sbt clean compile see this error:
[error] Error while emitting Routes.scala
[error] assertion failed: ...
0
votes
1
answer
89
views
play-pac4j: keep track of active sessions
What's the difference between PlayCacheSessionStore and PlayCookieSessionStore. I mean I understand that one stores data with play cache and the other stores data in cookie but I'm not sure to ...
0
votes
0
answers
25
views
Using the data of the children to order with eBean fails
I have two ebean object in Playframework 3.0.5 and ebean 3.0.0.
MessageThread, which has MessageItems:
In MessageThread:
@OrderBy("addDate ASC")
@OneToMany(mappedBy = "thread", ...
0
votes
1
answer
62
views
play.api.UnexpectedException: Unexpected exception[NoClassDefFoundError: javax/validation/ConstraintValidatorFactory]
Title:
Migration Issue to Play Framework 3.0.0: NoClassDefFoundError: javax/validation/ConstraintValidatorFactory
Body:
I'm migrating a Play Framework application from 2.9.4 to 3.0.0 to adopt Jakarta ...
1
vote
3
answers
238
views
How to write for play framework scala 3 enums reads, writes and format
I could see many threads pointing to solutions for Playframework json to work with scala 2 enums but none I could get working for scala 3 enums. Tried below solutions but not working
case class A(freq:...
0
votes
1
answer
64
views
Testing play framework controller with multipartdata
He guys,
I'm having issues with testing play controller that handles multipart form data. It expects text field and some files.
The controller uses temporary files def insert(): Action[...
1
vote
1
answer
84
views
Storing secrets in Play Framework
I am currently migrating all my auth related microservices from Node.js to Scala 2.13 and Play.
Where do you actually store your various password (like DB login, JWT secret, etc.) in your play ...
0
votes
0
answers
106
views
Play Framework 3.0.5 and jackson-databind version 2.17.0
I have a Play Framework 3.0.5 project on which I needed to update a module which has a requirement for jackson-databind version 2.17.0.
Since get the following error, and don't seem to be able to find ...
0
votes
1
answer
66
views
Scala/Play cant find custom library
I am a Scala beginner, having some initial issues with classpaths which I think may stem from sbt.
play.api.PlayException: Execution exception[[InjectionException: Injection error, interface my....
0
votes
1
answer
89
views
Sbt FlywayMigrate Command Hanging after Upgrading Flyway Sbt
After upgrading flyway-sbt from 7.4.0 to 9.22.0 the sbt flywayMigrate command now hangs, e.g. | => root / flywayMigrate {x}s . In our migration scripts, we are creating the indexes concurrently.
...
1
vote
0
answers
88
views
SAXParseException Being Thrown When Attempting to Upgrade From Scala 2.12.20 to 2.13.0
We're attempting to upgrade our Scala app from 2.12.20 to 2.13.0 but as soon as we do, we get the following error when trying to compile:
[error] (update) org.xml.sax.SAXParseException; lineNumber: 1; ...
0
votes
1
answer
53
views
GuiceApplicationBuilder and PlayTest tests erroring with play/Configuration not found on run path
We have our Playframework tests setup with fakeApplication using GuiceApplicationBuilder
class BaseSpec extends AnyFunSpec/PlaySpec with GuiceOneAppPerSuite {
override def fakeApplication(): ...
1
vote
1
answer
229
views
Swagger setup for Play3/scala2.13 project
I am trying to setup Swagger with Play.
I have tried 2 options to configure.
One is, https://github.com/play-swagger/play-swagger?tab=readme-ov-file#step-1, steps. After step-3 I am running into below ...
0
votes
1
answer
45
views
Firebase device token based push notifications not working in Java Play framework
I am using Java version 8, with Play framework version 2.2.6.
My firbase-admin dependency version is 6.8.1.
I tried initializing firebase in my code with the json file provided. Sharing the ...
0
votes
0
answers
142
views
Enable Zero-Code Instrumentation for gRPC Endpoint Metrics in a Play Framework App with OpenTelemetry
I have a Scala application built with the Play Framework that exposes a gRPC endpoint. Here's the current setup:
The application is instrumented with opentelemetry-javaagent.
The OpenTelemetry data ...
0
votes
2
answers
162
views
How to suppress a deprecation warning from a Play Framework routes file
I have a Play Framework application where the routes file uses a deprecated controller method:
GET /my-endpoint/this-is-deprecated com.example.app.controllers.MyController.getThisIsDeprecated
...
2
votes
0
answers
89
views
How can I resolve Guice/MissingImplementation error when it seems like there is an implementation?
In my test:
package com.megafarad.play.kafka.module
import com.google.inject.name.Names
import com.megafarad.play.kafka.services.KafkaProducerService
import io.github.embeddedkafka.EmbeddedKafka
...
1
vote
1
answer
305
views
Tracing transaction details with New Relic when passed to another thread
We are using New Relic Java agent with Play framework and having some troubles with tracking the transaction segments / details when the execution is passed on to another thread.
Consider this code:
...
0
votes
1
answer
49
views
issue trying to connect my playframework slick application with a postgres database runing in docker
here is my docker compose:
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
ports:
- '5432:5432'
volumes:
...
0
votes
0
answers
94
views
No implementation for ActorSystem<?> was bound
I'm trying to use play 3.0 with scala 3.5.
Here's my application.conf
req-dispatcher {
type = Dispatcher
executor = "fork-join-executor"
fork-join-executor {
parallelism-min = 8
...
1
vote
1
answer
109
views
Can time slicing and context switches cause high CPU utilization in a Java based application?
I have a Play framework application with about 400 threads. 200 are part of the default dispatcher.
Now I have 2 db sources with 9 connections each and thread pool with a min size of 20 and max of 200....
0
votes
1
answer
115
views
play -pac4j oidc password grant send redirect url to torken end point
implementing play-pac4j oidc feature with keyclock.
I need it to support only for direct access grant but play-pac4j request sends redirect_url as request parameter and getting error
< Invalid ...
0
votes
1
answer
176
views
Comparing impact of Scala PlayFramework's db.withConnection and db.withTransaction methods on the underlying postgres database
Given that there is just one simple SQL statement (example: select id from foo) that I need to execute on my Postgres 15 database, I am curious to know the performance impact of executing it using ...
0
votes
2
answers
139
views
Compilation Error: Instance not found: Conversion[models.Errorcode, _ <: Product] on Scala 3 Playframework
I've been recently migrating a playframework project from scala2 to scala3, and I found this error that only happens in scala 3 but it doesnt happen in scala 2:
play.sbt.PlayExceptions$...
1
vote
0
answers
94
views
Can I disable default Marker Context (NoMarker) passed implicitly when using play.api.Logger and require a different MarkerContext is always provided?
I am trying to add a unique request id to logs for each request that is made to a rest api. For that I want to pass implicitly a MarkerContext to each logger method called. Currently the NoMarker ...
0
votes
0
answers
1k
views
How to parse large JSON Strings(>5,000,000) using Play JSON?
I'm using Play JSON 2.9.4 in Scala.
implementation group: 'com.typesafe.play', name: 'play-json_2.12', version: '2.9.4
I'm unable to parse JSON Strings larger than 5,000,000 characters.
The exception ...
1
vote
0
answers
28
views
How to pass a value down the call stack in Scala Play app
I need to pass some information down the call stack in a Scala Play application.
For example:
class FooController: play.api.mvc.BaseController {
...
def method1(request: play.mvc.Http.Request) = {
...
0
votes
0
answers
148
views
Blank screen when connecting via Keycloak
I'm developping a web app that uses Keycloak 22 as an authentificator.
Sometimes, when I try to connect, my screen stays absolutely blank. This happens before accessing the login page. If I refresh my ...
0
votes
1
answer
63
views
xssprotection, noframe, nosniff not present on every request
I have a custom httpActionAdabter and i match matchers once also in the action adapter pac4jcsrf token and other matchers only will be present on register login and logout what i do to have them on ...
0
votes
2
answers
96
views
Pacj and Websocket authentication and authorization
@Secure doesn't work for websocket in pac4j-play how do i secure a websocket in java pac4j play
thanks
this what i don now
if (!profilesHelper.getProfilesWithHeader(request).isEmpty()) {
UserProfile ...
0
votes
1
answer
139
views
Is there any way to access a RequestContext in a play framework endpoint?
Is there any function or a way to work around the RequestContext in PlayFramework, that works similarly to Pekko's extractRequestContext?
I'm migrating an old Akka rest API to Play3.0, and I need to ...
0
votes
1
answer
134
views
Send data from a Post Request to the output of a Websocket in Play Framework (Scala)
I need some help with the Play Framework. I have this Websocket that immediately responds with a message to a client. My API has to be able to receive messages from another API, that sends them via ...
1
vote
1
answer
228
views
java.lang.IllegalStateException Sink.asPublisher(fanout = false) only supports one subscriber when using custom Playframework body parser as stream
After looking around stackoverflow and github issues, it seems this happened several times already in different contexts but never received any real help nor solutions so I try my luck once again.
We ...
0
votes
0
answers
396
views
Microsoft Teams integration in Java Play or Springboot framework for sending messages
I am working on creating a Java API for Microsoft integration with webhook URL for sending teams messages with API. Can anyone suggest a solution to this problem.
This is my Json data
{
"...
0
votes
1
answer
573
views
Play! 3.0 NoSuchMethodError: 'com.google.inject.Provider com.google.inject.util.Providers.guicify(javax.inject.Provider)'
I just returned to an old Play! framework project of mine which started in version 2.6.0 and has been updated to version 3.0.2
After fixing errors and updating the project to compile, I got it running!...
0
votes
0
answers
47
views
How to use play framework macros to parse and process json?
I am trying to convert json from one structure to another. In the process I would like to add a prefix to one of the string fields (if it exists). I need to use the play framework.
How would I add-to/...
0
votes
0
answers
37
views
Current User in Models scala playframework 2.8
I'm currently working on a web application using Play Framework 2.8 with Scala. In this application, I need to log which user is performing updates in the models or repositories. However, the system ...
1
vote
1
answer
39
views
Converting JsObjects in Scala: how to use optional fields?
I'm trying to create a scala function that converts a JsObject to one with a different structure.
All values are optional and so the function shouldn't throw an error if they don't appear on the input ...
0
votes
2
answers
99
views
Pac4j-Play Custom HttpErrorHandler not loading views
I have my own implementation of the interface HttpErrorHandler in a playframework java project. I managed to implement 4XX errors however the 403 & 401 views I created in CustomHttpErrorHandler ...
0
votes
2
answers
295
views
Install Play 1.7.1 on Windows
I've downloaded in C:\soft...
Java 8 (jdk-1.8.401)
Python (python-3.12.2-amd64)
git (v2)
play (play-1.7.1 imposed version)
I work on Windows (because of the migration that I have to do, of an old ...
1
vote
0
answers
37
views
Handling WebSocket Connections in Play Framework
I have a case where I need to re-use already open connections to a client and for this I'm storing the connections as soon as they are opened in a ConcurrentHashMap and when the server needs to send ...
0
votes
1
answer
63
views
build.sbt error: value addRepositoryAuthentication is not a member of lmcoursier.CoursierConfiguration
I have my private Gitlab lib repository defined as follow:
build.sbt
scalaVersion := "2.13.13"
/*** Gitlab private lib repository configuration ****/
resolvers += "gitlab" at "...
0
votes
0
answers
52
views
How to log incoming request with Scala & Play Framework?
Scala version is 2.13.8 and Play is 2.5.0 , I am getting Http 414 URI Too Long error and wanted to print that uri, how to manage that ?
1
vote
0
answers
236
views
reactivemongo with scala3, pekko, play-3
Is it possible to use reactivemongo with scala3, pekko and play-3.0.1?
The reactivemongo documentation suggests adding a dependency to
"org.reactivemongo" %% "reactivemongo-pekko" %...
0
votes
1
answer
129
views
Specs 2 - I want to mock one of the injected modules into the controller class
Let's say I have a class which has 10 auto injected items:
@Singleton
class ExampleClass @Inject() (
implicit
configuration: Configuration,
secondModule: SecondModule,
thirdModule: ThirdModule,...
4
votes
1
answer
708
views
Scala3 equivalent to -Wconf src filter
I have a Play framework application that I'm upgrading to Scala3. While migrating my compile flags I've encountered an issue that I've been unable to resolve by reading the docs.
With the flag ...
0
votes
0
answers
157
views
Using Selenium in Scala play not only for testing
I try to build a testing API on top of the play framework. This API call a Selenium Grid not only in tests but also on the main program.
I have the following build.sbt :
import scala.language....