https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
spring
  • b

    bdeg

    01/27/2019, 6:49 PM
    https://spring.io/guides/gs/multi-module/ Spring library can't be built in an MPP project targeting android, ios and jvm(java 8), is it the intended behavior?
    s
    • 2
    • 6
  • n

    nfrankel

    01/29/2019, 7:58 AM
    any idea how i could make delegated properties in kotlin work with jpa?
    s
    t
    +2
    • 5
    • 21
  • c

    Czar

    01/29/2019, 12:55 PM
    is there a way to get a hold of
    InjectionPoint
    in SpringFu kofu bean definition DSL?
    s
    • 2
    • 7
  • r

    reik.schatz

    02/07/2019, 3:07 PM
    @Component
    interface EventTransformer<T> where T: Event { ..
    
    @Component
    class LoginEventTransformer: EventTransformer<Login> { 
    
    @Component
    class FieldValueListRowMapper(transformers: List<EventTransformer<Event>>) { // autowires empty list
    c
    • 2
    • 2
  • a

    alieksie

    02/11/2019, 11:17 AM
    Hi Spring channel! I am having issue, building ReactiveEndpoint:
    @PostMapping(SEARCH_ROUTE)
    fun search(@RequestBody searchQuery: SearchQuery): Mono<SearchQuery> = searchService.save(searchQuery)
    save(searchQuery)
    returns Mono<SearchQuery>. When i return Mono.just(searchQuery), there are no issues. But when i return
    someMono.flatMap { ... }
    I am getting an error:
    ...SearchQuery cannot be cast to class java.lang.String
    Are there any tricks, or i miss something, when i use
    .flatMap
    ? 🙂
    c
    • 2
    • 18
  • b

    bjonnh

    02/12/2019, 7:18 PM
    I'm getting an error in IntelliJ saying that it cannot autowire because no Beans of type RoleRepository exist (I'm using :
    @Autowired
        private var roleRepository: RoleRepository? = null
    The application works properly, is there anything I can do about that?
    s
    i
    • 3
    • 8
  • s

    sdeleuze

    02/13/2019, 9:22 AM
    For Spring Boot: https://gitter.im/spring-projects/spring-boot
    r
    c
    • 3
    • 4
  • s

    sdeleuze

    02/13/2019, 4:01 PM
    https://twitter.com/sdeleuze/status/1095710763778535424
    s
    • 2
    • 4
  • s

    sdeleuze

    02/13/2019, 4:01 PM
    https://twitter.com/sdeleuze/status/1095714310712709120
    m
    t
    • 3
    • 12
  • s

    snowe

    02/14/2019, 10:18 PM
    -.txt
    m
    • 2
    • 2
  • v

    varpa89

    02/15/2019, 1:50 PM
    @sdeleuze can we use scheduling in spring-fu. I don't understand how to declare it instead of @enablescheduling annotation
    s
    • 2
    • 1
  • s

    sdeleuze

    02/15/2019, 2:58 PM
    https://twitter.com/sdeleuze/status/1096423498325651459
    ❤️ 6
    g
    s
    b
    • 4
    • 19
  • i

    Ivan Feliciano

    02/17/2019, 2:32 AM
    Anybody here got spring-boot-configuration-processor working with kapt?
    s
    • 2
    • 8
  • s

    sdeleuze

    02/18/2019, 1:38 PM
    https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1550497039044300
    👏🏾 3
    🎉 6
    👍 2
    g
    e
    • 3
    • 13
  • s

    Steven McLaughlin

    02/18/2019, 2:12 PM
    This may be a stupid question. It seems like the spring folks seem to like kotlin quite a bit. What is the roadmap with respect to kotlin? Is the idea to take advantage of kotlin under the hood and allow users to do whatever they want with that? Is the idea for it to be more first-class support for kotlin? I saw there were the jafu and kofu things both being developed. In say a year or two, do you anticipate a lot of users starting new spring projects to be using kotlin, or do you expect that most people will still be using java?
    s
    k
    • 3
    • 5
  • b

    bjonnh

    02/25/2019, 9:38 PM
    Is that the correct way to catch all /doi/<variable> where variable can be 10.10/foo
    x
    • 2
    • 6
  • t

    thanksforallthefish

    03/01/2019, 12:02 PM
    crossposting, https://kotlinlang.slack.com/archives/C0B8MA7FA/p1551432870022200 the conclusion seems to be that while the interface declares (if we consider javadocs a declaration) the
    value
    parameter as nullable (https://github.com/spring-projects/spring-hateoas/blob/master/src/main/java/org/springframework/hateoas/server/mvc/UriComponentsContributor.java#L46) spring data commons declares the implementation (
    HateoasSortHandlerMethodArgumentResolver
    ) as not nullable, therefore kotlin prevents to write something like
    override fun enhance(builder: UriComponentsBuilder, parameter: MethodParameter, value: Any?)
    . is it worth to create an issue?
    c
    h
    • 3
    • 2
  • s

    sdeleuze

    03/05/2019, 10:30 AM
    https://twitter.com/sdeleuze/status/1102878532680777728
    👍 1
    s
    • 2
    • 4
  • c

    Czar

    03/05/2019, 12:52 PM
    Gotta love websites which do not specify colours, relying on the OS defaults but forgetting the level of customizability of the OS UI.
    • 1
    • 1
  • s

    sdeleuze

    03/06/2019, 10:28 AM
    You may have a good surprise in upcoming Spring Boot 2.2 M1 which is just around the corner 😉
    ❓ 4
    :kotlin: 8
    🤘 1
    🤩 2
    t
    d
    +4
    • 7
    • 16
  • b

    bulbulpaul

    03/07/2019, 4:47 PM
    I’m converting from annotation based app to DSL based app.
    @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CLASS, AnnotationTarget.FIELD)
    @Retention(AnnotationRetention.RUNTIME)
    @Inherited
    @Qualifier
    annotation class Extra
    If there are multiple beans implementing the same interface, we used the Annotation class using the above @Qualifier. This time, I think that there are the following methods when it comes to describing it in Bean DSL. a: Define it as ref<>() where necessary in the Bean DSL. b: Specify with @Qualifier during constructor injection If you know other one how to implement it, please let tell me...😅
    s
    • 2
    • 2
  • p

    poohbar

    03/08/2019, 7:58 PM
    I upgraded from Spring Boot 2.0.6 to 2.1.3 and now my test beans defined in mockk suddenly stopped working.
    Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.example.core.feature.general.MyService$ByteBuddy$XNiBjGz8$ByteBuddy$rk2gOXmp: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.NoClassDefFoundError-->com/example/core/feature/general/MyService$ByteBuddy$XNiBjGz8$ByteBuddy$rk2gOXmp
    I found this: https://github.com/raphw/byte-buddy/issues/486 Could it be somehow related to ByteBuddy? I know that Spring Boot now supports Java 11 for the first time. This is how I define my test mocks.. used to work perfectly:
    @Bean
    fun myService() = mockk<MyService>(relaxed = true)
    j
    • 2
    • 2
  • r

    reik.schatz

    03/11/2019, 10:01 AM
    @Value("\${test.user.count.under.test:6}")
        var testUserCountUnderTest: Int = 6
    i
    t
    • 3
    • 8
  • j

    Jonas Bark

    03/15/2019, 2:16 PM
    Regarding https://github.com/spring-projects/spring-fu/issues/16: We're trying to use the spring-security module but as we're using the functional approach using spring-fu there's no way to use @EnableWebFluxSecurity annotation. Is that correct? Is there a way support both, functional and annotation based processing? The functional approach worked great so far so it would be a real bummer if there's no way to make it work right now.
    s
    • 2
    • 36
  • o

    oleksiyp

    03/15/2019, 10:33 PM
    @sdeleuze I am wondering if there will be ever STOMP library based on Reactor in Spring. I've done some prototyping and seems Reactor is not the best option for dynamic subscriptions. Particularly there are not many processors that can be used and all have some pros and cons(more cons). I can talk in more detail about it, but my prototype failed. It didn't pass the test of repetitive subscription/unsubscription with 100 ms delay to receive messages. I tried many different approaches while trying to pass this test, fixed memory leaks, thread leak, but at some point, with the best implementation that I could achieve messages anyway just stop coming. Then I tried to do a prototype using coroutines and it was developed a lot faster and passed many different tests without problems. As a plus related to structured concurrency you can have a supervisor job associated with a subscription that finishes everything that was launched per subscription, per destination, per transaction, e.t.c. So the question is what are plans about STOMP in this regard?
    s
    • 2
    • 2
  • l

    lex

    03/18/2019, 3:53 AM
    @sdeleuze is thtere coroutine suuport in spring data?
    s
    • 2
    • 2
  • q

    qwert_ukg

    03/19/2019, 10:11 AM
    How to remove
    Thread.sleep(1000)
    and start second part of test, right directly after launch will be complited?
    -.kt
    c
    i
    d
    • 4
    • 9
  • x

    xenoterracide

    03/19/2019, 8:15 PM
    spring data question
    interface InserterPacket100hz {
        fun myInsertAll(list: Collection<Packet100hz> )
    }
    interface Packet100hzRepo: CrudRepository<Packet100hz, RFID>, InserterPacket100hz
    
    @Repository
    internal class Packet100HzInsertImpl(private val jdbc: JdbcTemplate): InserterPacket100hz {
    
        override fun myInsertAll(list: Collection<Packet100hz>) {
            var sql = "INSERT INTO packet_100hz_secure (rfid, pressure_signal, uo_pressure, chamber_pressure, ultrasonic_signal, \"timestamp\") VALUES "
            for (packet100hz in list) {
                // 6 cols
                sql += "(?, ?, ?, ?, ?, ?)\n" // maybe should use string builder
            }
            val inserts = list.flatMap {
                listOf(
                    it.rfid.rfid,
                    it.pressureSignal,
                    it.uoPressure,
                    it.chamberPressure,
                    it.ultrasonicSignal,
                    it.rfid.timestamp
                )
            }.toTypedArray()
            jdbc.update( sql, inserts )
        }
    }
    Caused by: org.springframework.data.mapping.PropertyReferenceException: No property myInsertAll found for type Packet100hz!
    … well no duh spring… trying to do a custom repository implementation, anyone know what I’m doing wrong?
    t
    c
    • 3
    • 16
  • s

    sdeleuze

    03/27/2019, 8:13 AM
    Hey, does anybody knows if there is a cleaner way than what I did in https://github.com/spring-projects/spring-fu/blob/master/kofu/src/main/kotlin/org/springframework/fu/kofu/BeanDefinitionDslExtensions.kt (defining 22 reified overloaded methods from
    Function1
    to
    Function22
    ) to acheive reflection-less injection of parameters by type?
    c
    • 2
    • 9
  • c

    Czar

    03/27/2019, 10:40 AM
    I've stumbled upon a strange thing in spring-fu. Tests written in java using
    var
    , which is JDK10+ feature, while there is this in build.gradle.kts:
    tasks.compileJava {
    	sourceCompatibility = "1.8"
    	targetCompatibility = "1.8"
    }
    How does this work? My IntelliJ is swearing at me 🙂
    c
    s
    • 3
    • 7
Powered by Linen
Title
c

Czar

03/27/2019, 10:40 AM
I've stumbled upon a strange thing in spring-fu. Tests written in java using
var
, which is JDK10+ feature, while there is this in build.gradle.kts:
tasks.compileJava {
	sourceCompatibility = "1.8"
	targetCompatibility = "1.8"
}
How does this work? My IntelliJ is swearing at me 🙂
c

christophsturm

03/27/2019, 10:47 AM
tests are probably compiled via tasks.compileTestJava
c

Czar

03/27/2019, 10:51 AM
but that one is not configured, so I assume 1.8 is used for both...
c

christophsturm

03/27/2019, 10:54 AM
i think it stays at the default value
JavaVersion sourceCompatibility
Java version compatibility to use when compiling Java source. Default value: version of the current JVM in use JavaVersion.
c

Czar

03/27/2019, 11:01 AM
Ok, so that's resolved by specifying JDK 11 for gradle in IntelliJ settings.
Thank you, your comment nudged me in the direction of the solution.
c

christophsturm

03/27/2019, 12:04 PM
yw! I do think that it should be specified in the gradle file, i was just guessing why it works for some people without.
s

sdeleuze

03/27/2019, 2:44 PM
https://github.com/spring-projects/spring-fu/commit/56fa18d684cb4daeca7166d9adf36ad09b962787
👍 2
View count: 3