17,285 questions
1
vote
0
answers
27
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
31
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(): ...
0
votes
1
answer
57
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
0
answers
41
views
Firebase Push Notifications Failing on Dev Server: java.io.IOException Access Token Error in Java
I am encountering the following exception when sending push notifications (both token-based and topic-based) using Firebase in my Java Play Framework application on the development server:
Caused by: ...
0
votes
0
answers
12
views
EBean in Play! Framework and many-to-many relationship on one class
I have a class StreamingProvider which can have child StreamingProviders. There are various combinations possible, so it is a n-n relationship:
@Entity
public class StreamingProvider extends ...
0
votes
1
answer
28
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
50
views
Test Case Action.async in Scala Play Framework
I'm working on Scala and the Play Framework project, and we are trying to write test cases using PlaySpec with GuiceOneAppPerTest, MockitoSugar, and BeforeAndAfterAll.
Here's the function we are ...
0
votes
0
answers
77
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
75
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
...
0
votes
0
answers
39
views
play-pac4j SAML profile not in session after redirect
Very odd issue with IDP-initiated SAML auth. The user profile is somehow lost after a redirect. SAML assertion checks out. I extract the UserProfile and save it in the Play session and then do a ...
2
votes
0
answers
57
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
100
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
35
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
28
views
Upgrading to Play 2.9 leads to 503 - upstream connect error or disconnect/reset before headers. reset reason: connection termination for Test Clients
I have been using Play 2.8 successfully without any major issues, however upon upgrading it to 2.9 due to some HTTP connection issues my integration tests that were written in Java have started ...
0
votes
0
answers
61
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
...
0
votes
0
answers
29
views
Play Framework migration: NoSuchMethodError: play.api.ApplicationLoader$.createContext
I am having a problem migrating from Play 2.5 to 2.6. My project builds successfully, but when I try to run it, the following exception message is thrown:
Caused by: java.lang.NoSuchMethodError:
play....
1
vote
1
answer
91
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
0
answers
51
views
Unable to query using Reference id in morphia 2.4.14 for Reference entity. use of Key<> is deprecated
I have an Entity Book. It contains Language entity. Language entity is stored as DBRef() in database. I need DBRef.
@Entity("Book")
class Book{
@Reference(language_id)
private Language ...
0
votes
1
answer
86
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
58
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
105
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
69
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
616
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
27
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
90
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
51
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
57
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
0
answers
38
views
Play Framework Ebean Firebird
I have a project in Play 2.8.18 but now I want to update it to Play 3.x.
There is a new version of Ebean 8.xx but it looks like it doesn't support Firebird 2.5
I'm testing using the "play-samples-...
0
votes
1
answer
99
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
97
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 ...
0
votes
0
answers
137
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
240
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
350
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
37
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
32
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
34
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
68
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
208
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 ...
0
votes
0
answers
21
views
Handling of WebSocket Client Messages in Play Framework
I have a case where my client opens a WebSocket connection upon which I subscribe to a MQTT topic and fetch the messages that I need to publish to this client. It could be that in-between the client ...
1
vote
0
answers
26
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
0
answers
29
views
Handling WebSocket Connections in Play Framework in Scala
I have a Play Framework based WebSocket connection defined as below:
def socket(chargingStationId: String, isPersistentConn: Boolean): WebSocket = WebSocket.acceptOrResult[JsValue, JsValue] { ...
0
votes
1
answer
34
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
42
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 ?
0
votes
0
answers
34
views
Optionally enable Scala play to accept mLTS credentials?
I have two servers: server A and server B.
Server A has a security layer through MTLS where it expects keyStore details from server B for accessing its endpoint. However when server A requests to ...
1
vote
0
answers
178
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
102
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
425
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
131
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....
0
votes
0
answers
51
views
How to execute PUT REST client code using playframework in scala
I am new to Scala and struggling to get a simple PUT REST client working.
I am modifying existing code which is using StandaloneAhcWSClient
https://www.playframework.com/documentation/2.6.0-M2/api/...
0
votes
0
answers
131
views
ERROR akka.actor.ActorSystemImpl(applica Uncaught error from thread, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem
I am working on an Android app and I am trying to get the login function to work, when a user logins a request should be sent to the backend for it to authenticate the information provided and send ...