112,825 questions
0
votes
0
answers
13
views
First message to akka actor occasionally dropped
I am using typed actors with akka 2.6.21. It appears that occasionally in our unit tests, a message sent to an actor just after it is created is getting lost. The outline of the test is
val actor = ...
0
votes
0
answers
39
views
In jaxb, can I distinguish between elements that have the same type but different names?
I am trying to process XMLs in Scala which have an awkward XSD where different element names are mapped to the same type.
<xsd:element name="NVAnfangF" type="NVAnfang"/>
...
0
votes
1
answer
37
views
Scala 2 annotation macro weirdness
I have these three macros all defined in the same file (and with the same exact definition):
class client(val port: Int = 9000) extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = ...
0
votes
1
answer
53
views
Function objects with arguments that extend a trait
I have the following code. The compiler complains about the last line. I am wondering why. The WrappedFunction case class takes a function object with trait arguments. When I try to construct a ...
0
votes
1
answer
47
views
Lookback logic in spark scala dataframe
I am trying to write lookback logic for transactional table as below.
P_ID Desc P_Date
100 ABC 2025-04-23
101 XYZ 2025-04-23
102 LMN 2025-04-23
103 CDE 2025-04-23
101 XYZ 2025-04-15
103 CDE 2025-04-10
...
0
votes
0
answers
53
views
Can't run Scala project due to NoClassDefFoundError [closed]
My colleague is having difficulties running tests in a Scala sbt project due to the following error, but I can run the tests fine without this error.
io/circe/derivation/EncoderNotDeriveSum java.lang....
0
votes
1
answer
66
views
AWS Lambda not works with Cats Effect IO (Scala)
I try to run function written on Scala with Cats IO using. Simple Scala functions from https://aws.amazon.com/blogs/compute/writing-aws-lambda-functions-in-scala/ and https://rockthejvm.com/articles/...
1
vote
0
answers
41
views
Scala sbt operation: Duplicate slf4j error
Project is configured in build.sbt file:
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.16"
lazy val root = (project in file("."))
.settings(
...
0
votes
0
answers
28
views
Implement a `def` with a `val` [duplicate]
I have this scala code
import scala.util.{ Success, Try }
abstract class Base:
def foo: Try[String]
class Derived extends Base:
override val foo = Success("foo")
It compiles, which ...
-2
votes
0
answers
35
views
I want to create a task which will be calling a procedure and the procedure will be calling a scala file on snowflake [closed]
I want to make a Snowflake task which will call a procedure and the procedure will be calling the Scala file. Please refer the below diagram:
+--------------------+
| Snowflake Task |
|------------...
1
vote
0
answers
78
views
Converting Duration to YearToSecond with jooq I don't get the initial value when converting back to Duration
I'm trying to convert from a Duration into jooq's YearToSecond and then convert back to duration. I've realised that my result is different from the initial duration. Here's my test:
If I do:
val ...
1
vote
1
answer
51
views
ZIO timeout not timing out even with disconnect
I'm trying to set up something in ZIO to timeout other tasks, but not finding anything which is able to interrupt them reliably.
import zio.*
object MainApp extends ZIOAppDefault {
def spinny(): ...
1
vote
1
answer
59
views
Scala Http4s: combine 2 AuthMiddleware
I create 2 middlewares for 2 authentification roles:
First:
private val basicStudentAuthMethod = Kleisli.apply[IO, Request[IO], Either[String, Student]] { req =>
val authHeader = req.headers.get[...
0
votes
1
answer
39
views
Remote debugging a scala-maven application in vscode
I am looking to remote debug a basic Scala Maven 'hello world' application, but I am unable to do so. Here is the code for the application https://github.com/231tr0n/scala-example-template/.
The app ...
2
votes
2
answers
64
views
Looking up and setting elements of java.util.Properties using dot notation in Scala
I am working through Scala For the Impatient by Horstman. I'm not doing this for a class. In the book, he has code that dynamically looks up and sets elements from an instance of java.util....