André Martins
10/16/2024, 9:25 AM@Configuration
@ConfigurationProperties(prefix = "my-config")
data class MyConfig(
var blacklist: List<BlackListEntry> = emptyList(),
)
data class BlackListEntry(
val name: String,
val values: List<String> = emptyList(),
)
And I'm using spring.config.import
to import an additional application.yaml in my environment. The thing is I get java.lang.IllegalStateException: No setter found for property: blacklist
When I change the blacklist to be a MutableList it works, does spring first instantiate MyConfig for the base application.yaml and then try to call the setters with the additional imports? Shouldn't it merge the yamls first and only call the constructor once? Any ideias how can I keep the list as immutable?
Im using spring-boot 3.2 btw
Thanks in advance ✌️Pihentagy
10/22/2024, 6:36 AMPihentagy
10/22/2024, 6:38 AMSimon Nyström
11/11/2024, 2:08 PM@GetMapping
is working as usual but something has changed with @PostMapping
? It correctly maps the @GetMapping
methods but debug logs this for my @PostMappings
: Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
Any ideas what I can do to fix this?Robert Jaros
11/13/2024, 6:04 PMkotlin-spring
plugin but now I'm seeing Classes annotated with '@Configuration' could be implicitly subclassed and must not be final
errors for all my configuration classes. Is this a known issue?corneil
01/13/2025, 3:46 PMorg.springframework.boot:spring-boot-configuration-processor
to ensure propeties classes with @ConfigurationProperties
are properly detected.mathias8dev
01/16/2025, 11:04 AMursus
01/18/2025, 11:45 PMList
working with restTemplate.getForObject<List<X>>
kotlin extension? I'm getting class cast exceptionskurt_steiner
01/21/2025, 2:00 PMursus
01/28/2025, 3:19 AMlistOf(
Person(
name = "foo",
age = 44,
fooBar = "lol",
isImportant = true,
isNew = true
)
)
Why does this get serialized into json as [{"id":null,"name":"foo","age":44,"fooBar":"lol","new":true,"important":true}]
?
I.e. missing the is
prefixes?
What's even worse is when I try to deserialize the same json that was just serialized, I'll get errors.
Broken by defaultEugen Martynov
01/30/2025, 9:31 AMTeodor Irkhin
01/31/2025, 10:01 AMsdeleuze
02/14/2025, 5:39 PM@Configuration
with functional bean registration. Feedback is welcome. https://github.com/spring-projects/spring-framework/issues/18353#issuecomment-2659889622sdeleuze
02/14/2025, 5:50 PMRobert Jaros
02/14/2025, 6:08 PMinitialize
method is executed). Am I correct?sdeleuze
02/14/2025, 8:10 PMElise
03/02/2025, 1:01 PMRobert Jaros
03/02/2025, 8:47 PMspring-dependency-management
plugin and Kotlin/JS compiler? Not long ago I've reported it breaks incremental compilation of K/JS (https://youtrack.jetbrains.com/issue/KT-74378). Now I have problems with serialization (see: https://kotlinlang.slack.com/archives/C7A1U5PTM/p1740943473638099). I've always thought this plugin just reads some BOMs and auto-applies correct version of various dependencies. But how it is possible that it breaks compilation?sdeleuze
03/06/2025, 6:56 PMEric
03/27/2025, 12:52 PMAbstractRoutingConnectionFactory
and override getTargetConnectionFactory
. My function signature is just override fun getTargetConnectionFactory(lookupKey: Any?): ConnectionFactory?
but the compiler is rejecting that, and only accepts override fun getTargetConnectionFactory(lookupKey: Any): ConnectionFactory
. Looking at how getTargetConnectionFactory
is used, it can clearly accept a null lookupKey
and return a null ConnectionFactory
. Am I missing something obvious here? I don't see any nullability annotations on getTargetConnectionFactory
AbstractRoutingConnectionFactory
or any package-info.java
that specifies package-wide null behavior. Spring Boot 3.4.3, spring-rabbit 3.2.3, Kotlin 1.9.23.horse_badorties
03/31/2025, 2:11 PMthanksforallthefish
04/02/2025, 8:08 AM// producer thread, saves its trace information within the message
producer.produce(message.withTraceDetails())
// consumer thread, actually even another application instance
// up to this consumer.read, its an independent trace
val message = consumer.read()
processAfterRestoring(message.traceDetails()) {
// here the trace is restored from the message
process(message)
}
fun processAfterRestoring(sourceTrace: Trace, supplier: () -> Any)
The code we have works in normal scenarios, but not when process(message)
uses coroutines, eg
// here we have TraceONE
val message = consumer.read()
processAfterRestoring(message.traceDetails()) {
// here the trace is restored from the message
process(message)
}
fun process(message: Message) {
// here the trace is restored from the message
launchNewCoroutine {
// but here the trace is again TraceONE
doSomethingOn(message)
}
}
fun processAfterRestoring(sourceTrace: Trace, supplier: () -> Any)
I reproduce some more code (in thread, hopefully I captured all the relevant pieces).
I guess the 3 questions that pop up to me are:
• are we restoring traces incorrectly (not kotlin)?
• is there some issue with our Spring context config (also not kotlin)?
• what magic am I not seeing in observationRegistry.asContextElement()
that causes the issue (since when we don't use coroutines, restoring works I am kinda discounting the first 2 questions and focusing more on this last one)?Pritt Balagopal
04/02/2025, 7:36 PMorg.springframework.lang
? The online Javadoc for the website does indicate that it does https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/lang/package-summary.html however, on Kotlin's own source file, it is not mentioned anywhere here: https://github.com/JetBrains/kotlin/blob/master/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JvmAnnotationNames.kt. I am confused, does Kotlin support it or not? And if so, how does it do so despite not being listed?Edgar
04/12/2025, 10:37 AMPihentagy
04/14/2025, 10:46 AMcreatedAt
field in my @Entity
. and it gets its value as the Entity is created. Can this info be utilized, so that "all saved entity has non-null createdAt" at kotlin level, or do I have to check against null every time? Or I have no choice but declare it as
var timestamp: Instant? = null,
Emil Kantis
04/29/2025, 11:01 AMChannel
?Alex
05/09/2025, 5:32 PM