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
  • g

    Gerard Klijs

    08/05/2018, 7:33 PM
    Anybody used Spring Fu yet? I wanted to give it a try, but from https://github.com/spring-projects/spring-fu/tree/master/modules it seems you can only use that subset of modules which are made ready for Spring Fu. I would like to port a reactive app that is using mongodb and kafka, and I don’t see how to integrate it, but I guess if I really want to I could use the non-spring reactive kafka dependency?
    t
    • 2
    • 2
  • d

    deinspanjer

    08/06/2018, 2:19 PM
    I just asked this question on the getting-started channel, but wanted to share it here in case the right person isn’t on that channel. 🙂
    n
    c
    • 3
    • 5
  • d

    deinspanjer

    08/08/2018, 12:11 PM
    argh! Is there an example somewhere of using the kotlin-noarg plugin? The docs say “Then specify the list of no-arg annotations”. Does this mean that I have to write my own annotation class to be able to use it? I see some references in stackoverflow to people just adding
    @NoArg
    to their data class, but no information on what other setup is needed to get that to work
    c
    • 2
    • 40
  • l

    luke

    08/30/2018, 7:24 PM
    The exception is: Instantiation of [simple type, class com.foo.bar.Goalscorer] value failed for JSON property event due to missing (therefore NULL) value for creator parameter event which is a non-nullable type.
    0adf0a47604bf8b0fa5d3d62384758e35fc89506.txt
    d
    • 2
    • 8
  • s

    Scott Shidlovsky

    09/05/2018, 4:50 PM
    How can @NotNull be handled for spring validation. For example in the following request I want spring to check that the fields are not null and send an error if they are.
    data class NameRequest(@field:NotNull val firstName: String, @field:NotNull val lastName: String)
    But when making the request, I get a 500 server error. java.lang.IllegalArgumentException: Parameter specified as non-null is null: method NameRequest.<init>, parameter firstName", Do all fields have to be marked nullable? I used the spring starter for kotlin which contains the kotlin-jackson dependency.
    f
    d
    • 3
    • 3
  • s

    sdeleuze

    09/13/2018, 9:27 PM
    And we work with GraalVM team to make Spring + Kotlin application working as GraalVM native images
    🎉 1
    l
    • 2
    • 1
  • w

    wakingrufus

    09/13/2018, 10:57 PM
    can it only run against kotlin 1.3 Milestone?
    s
    • 2
    • 5
  • s

    saunaCat

    09/17/2018, 8:46 AM
    Hi ☺️ has anybody here been using spring cloud streams kafka binder, and the metrics you get from spring.cloud.stream.binder.kafka.offset? It’s supposed to give the number of messages not yet consumed on a topic, but is given in milliseconds and I’m not sure how to present these series of metrics in a graph (using grafana). Would be super if someone could help out 🌷
    :stackoverflow: 1
    :java: 3
    g
    • 2
    • 1
  • l

    Lonwabo

    09/21/2018, 7:01 AM
    Hi All, I am are currently rewriting a legacy system with Kotlin, Spring boot and JPA and so I have three modules of which two are services and a shared module which includes entities, Utils and repositories etc. Now on the dependent projects main I have used annotations @ComponentScan(value = ["com.bla.mypackage"]) and @EnableJpaRepositories and I can run the services and beans are autowired but when I run tests I get Unsatisfied dependency exception and my testBase is annotated with Test and @ContextConfiguration(classes = [MyService::class]). What could I be missing or doing wrong?
    j
    • 2
    • 1
  • f

    fabricio

    09/26/2018, 12:21 PM
    @GetMapping
        fun getIdentities(payload: IdentitySearchRequest, pageable: Pageable) =
            service.searchProcess(payload, pageable)
    I`m trying to map the query string of this request to that class. But it doesn`t work. Any idea? Its spring boot
    d
    • 2
    • 1
  • s

    sdeleuze

    10/02/2018, 2:39 PM
    https://kotlinlang.slack.com/archives/C0B8RC352/p1538489385000100
    👍 1
    🔥 3
    g
    • 2
    • 1
  • d

    darych

    10/05/2018, 9:06 AM
    Hi! Yesterday I published a post how to use Mockk to test Spring Boot controllers without Mockito. Please share your thoughts or improvements: https://medium.com/@darych90/kotlin-spring-boot-mockk-6d1c1a6463ac
    👍 2
    i
    • 2
    • 3
  • s

    s1m0nw1

    10/08/2018, 12:25 PM
    would it be possible to write a
    @MockKBean
    annotation (esp. the corresponding processor) that works with MockK instead of Mockito?
    👍 1
    🤔 1
    d
    • 2
    • 1
  • v

    veiset

    10/09/2018, 1:17 PM
    Maybe slightly off-topic, but somebody at my company wants to learn Spring/Spring Boot in depth. Are there any courses on Kotlin + Spring that anyone can recommend? (doesnt have to be free)
    n
    • 2
    • 1
  • j

    jasper

    10/13/2018, 2:27 AM
    ^-- When I update the sample here to use Kotlin 1.2.71, it fails. Do Spring Boot and Kotlin 1.2 work together?
    s
    • 2
    • 11
  • o

    orangy

    10/13/2018, 3:09 PM
    Why not integrate Exposed with the Spring Data instead? You’re suggesting essentially forking DSLs and fragmenting community
    👍 2
    o
    s
    n
    • 4
    • 5
  • l

    lex

    10/15/2018, 4:39 AM
    is there any plans to integrate spring transactional model with coroutines?
    s
    c
    • 3
    • 11
  • t

    Tristan Caron

    10/16/2018, 2:29 PM
    Hello, I am trying to read properties but it never returns the correct value. This is what I use
    @Component
    @ConfigurationProperties
    @PropertySource("classpath:app.properties")
    class AppProperties {
        lateinit var mongoUri: String
        lateinit var manticoreEndpoint: String
        lateinit var manticorePlatform: String
        lateinit var manticoreUsername: String
        lateinit var manticorePassword: String
        lateinit var internalToken: String
    }
    My properties look like
    mongo-uri=""
    mantictore-endpoint=""
    I also added
    @EnableConfigurationProperties
    . I missed something? Thanks for your help.
    j
    m
    s
    • 4
    • 15
  • c

    christophsturm

    10/18/2018, 10:18 AM
    not really kotlin related, but can i use spring persistency on an app thats not spring based? (i want to start using spring components)
    s
    • 2
    • 5
  • s

    sdeleuze

    10/18/2018, 10:27 AM
    BTW I plan to migrate the Spring Boot + Kotlin tuto from JPA to Spring Data JDBC https://github.com/spring-guides/tut-spring-boot-kotlin/issues/17. See

    https://www.youtube.com/watch?v=AnIouYdwxo0▾

    for more details.
    👍 7
    🤔 1
    c
    • 2
    • 8
  • c

    corneil

    10/18/2018, 11:05 AM
    I'm wondering if the Kotlin team has considered automatically treating Optional<T> like T?
    s
    • 2
    • 1
  • g

    Gleb Stsenov

    10/19/2018, 10:05 AM
    Hello. Me noob here, but Google has no ideas, and slack search neither. Anyone using proguard with kotlin and spring boot gradle plugin 2.x? I'm trying to make it obfuscated during the build and after translation, but no luck to find some task entry point
    r
    c
    • 3
    • 10
  • f

    fabricio

    10/22/2018, 3:04 PM
    com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of
    com.example.api.LoginEvent
    , problem: kotlin/jvm/internal/Intrinsics does anyone know why this error?
    d
    • 2
    • 3
  • m

    mp

    10/23/2018, 10:11 AM
    Hi there Does anyone use spek for testing spring apps?
    c
    n
    c
    • 4
    • 6
  • u

    Udit003

    10/24/2018, 2:36 PM
    I am using Spring MVC with kotlin. In one of my Controller methods, I want to redirect to a internal url if a particular condition is met, else I want to serve a json object. This is my current code (striped down version)
    fun serveRequest(response :HttpServletRes)  : ResponseObject?  {
        if(condition_satisfied) {
             response.status = HttpServletResponse.SC_MOVED_PERMANENTLY
                response.sendRedirect("/new_path")
                return null
        } else {
           return Responsebject()
       }
    }
    This gives me 2 problems : 1. even if the response status is explicitly set 301 , it returns 302 2. The code looks a bit "hacky" to me, getting a feeling that better code can be possible.
    d
    n
    • 3
    • 13
  • a

    avolkmann

    10/30/2018, 1:35 AM
    Anyone else having issues with
    Could not find org.jetbrains.kotlin:kotlin-spring
    in gradle? I followed the docs here: https://kotlinlang.org/docs/reference/compiler-plugins.html
    • 1
    • 2
  • d

    dmulligan

    11/01/2018, 3:11 PM
    In Spring, what is the simplest way to convert a
    List
    to a
    Page
    using
    Pageable
    ? My understand of
    PageImpl(List<T> content, Pageable pageable, long total)
    is that it does not slice up the list content as was requested in
    Pageable
    . It also does not apply the
    Pageable.sort
    to the content list.
    t
    • 2
    • 1
  • d

    dmulligan

    11/01/2018, 3:11 PM
    I have the following, but it does not take Pageable.sort into account
    fun <T> List<T>.toPage(pageable : Pageable) : Page<T> {
        val content = when {
            (pageable.offset < size) -> subList(pageable.offset, minOf(pageable.offset + pageable.pageSize, size))
    
            else -> emptyList()
        }
        return PageImpl(content, pageable, size.toLong())
    }
    l
    • 2
    • 3
  • t

    thanksforallthefish

    11/02/2018, 3:50 PM
    at some point down the stack (
    KotlinCopyMethod.java
    ) I get a call to this method
    private static Optional<Method> findSyntheticCopyMethod(Class<?> type) {
    
    		return Arrays.stream(type.getDeclaredMethods()) //
    				.filter(it -> it.getName().equals("copy$default") //
    						&& Modifier.isStatic(it.getModifiers()) //
    						&& it.getReturnType().equals(type))
    				.filter(Method::isSynthetic) //
    				.findFirst();
    	}
    but
    type.getDeclaredMethods()
    contains
    public static Masterplan Masterplan.copy-Tarbdzk$default(Masterplan,java.lang.Integer,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,java.lang.Object)
    ->
    Tarbdzk
    ????
    s
    • 2
    • 3
  • s

    sdeleuze

    11/05/2018, 8:59 AM
    Be aware there is currently an issue in Kotlin 1.3 that prevents using Spring: https://youtrack.jetbrains.com/issue/KT-27878
    👍 2
    j
    • 2
    • 4
Powered by Linen
Title
s

sdeleuze

11/05/2018, 8:59 AM
Be aware there is currently an issue in Kotlin 1.3 that prevents using Spring: https://youtrack.jetbrains.com/issue/KT-27878
👍 2
j

jacob

11/05/2018, 10:14 AM
should it affect everyone? we have some spring apps at work that were upgraded but don't seem to be affected by this
s

sdeleuze

11/05/2018, 10:15 AM
Not everyone but that's a pretty serious one I would say
j

jacob

11/05/2018, 10:36 AM
sounds very serious. something I'll have to audit tomorrow and see if we need to rollback
thanks for the heads up 🙂
View count: 2