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

    irus

    03/02/2017, 11:31 AM
    (and free internet point here http://stackoverflow.com/questions/42553822/spring-web-flux-reactive-functional-route-not-working-as-expected-with-kotlin)
    s
    s
    • 3
    • 3
  • k

    kenkyee

    03/02/2017, 11:35 AM
    GET("{id}/hello") would be what I would have used
    s
    • 2
    • 5
  • c

    cleiter

    05/05/2017, 7:10 AM
    ☝️ anyone? it's strange that parameter name detection works in rest controllers but not in jpa repositories
    s
    • 2
    • 5
  • j

    j_kapp

    05/09/2017, 9:06 AM
    Hi there. I am getting up to speed with Spring REST and I noticed that my id field is being appended to the end of the self URI. This is exposing an internal id which is bad practice. How do I designate the userName field as also being unique, and that is the field that should be appended to the URI? Thanks.
    @Entity
    data class User(
            @Id
            @GeneratedValue(strategy = GenerationType.AUTO)
            val id: Long,
            val userName: String)
    • 1
    • 1
  • r

    roberto.guerra

    05/23/2017, 1:38 PM
    personally I prefer not to add another dependency and just use the
    open
    keyword. Even with Spring Boot, I keep most (if not all) business logic outside of Spring, and just use a thin layer of spring artefacts to wire them up. So adding
    open
    isn’t a hassle for me. I can see how it is a hassle if most things in the application are some sort of spring “artefact”.
    s
    • 2
    • 2
  • d

    dmnk_89

    05/26/2017, 8:24 AM
    Hi, I have a problem with
    ObjectMapper
    when i try to convert json to
    Map
    objectMapper.convertValue("{}", Map::class.java)
    i get an exception
    com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of java.util.LinkedHashMap: no String-argument constructor/factory method to deserialize from String value ('{}')
     at [Source: N/A; line: -1, column: -1]
    same thing when json has fields in it. Any ideas?
    • 1
    • 1
  • s

    sdeleuze

    05/27/2017, 2:47 PM
    https://twitter.com/sdeleuze/status/868362542434983936
    :kotlin-flag: 11
    b
    • 2
    • 1
  • j

    jasper

    05/31/2017, 4:39 AM
    @dh44t What's the import to use the extensions? Not working for me.
    d
    • 2
    • 2
  • j

    jasper

    06/01/2017, 11:56 PM
    Does the all-open plugin support checking the parameter args to an annotation or only the presence of it? I can see
    @RunWith(SpringRunner::class)
    being generally useful for others.
    @SpringBootTest
    could definitely be added to
    kotlin-spring
    . I'll open a request
    👍 1
    s
    • 2
    • 4
  • s

    ssouris

    06/05/2017, 2:11 PM
    Hey guys 🙂 Here is a post I made about using Kotlin with Spring 5 http://yetanotherdevblog.com/petclinic_spring_5_kotlin_reactive_mongodb and here is the code https://github.com/ssouris/petclinic-spring5-reactive/ Let me know what you think
    🤘 2
    s
    • 2
    • 2
  • r

    rpalcolea

    06/06/2017, 8:47 PM
    fuel? or use Retrofit with Kotlin?
    s
    • 2
    • 1
  • r

    rpalcolea

    06/06/2017, 10:04 PM
    guess it requires
    spring-boot-starter-webflux
    s
    • 2
    • 2
  • r

    rpalcolea

    06/07/2017, 2:12 AM
    @sdeleuze is there out of the box support for hystrix in
    WebClient
    or that;s something in the works?
    s
    • 2
    • 1
  • m

    michael.barker

    06/15/2017, 3:14 AM
    @x80486 Have you tried setting this property?
    spring.jackson.property-naming-strategy=SNAKE_CASE
    x
    • 2
    • 1
  • d

    dariuszbacinski

    06/16/2017, 8:26 PM
    there are some gitter channels regarding spring, like this one https://gitter.im/spring-projects/spring-boot
    u
    r
    • 3
    • 2
  • s

    sdeleuze

    06/21/2017, 8:29 AM
    @Czar This is a super basic use case tested and validated multiple times. Could you share a repro project on GitHub?
    c
    f
    u
    • 4
    • 4
  • c

    Czar

    06/23/2017, 7:29 AM
    Hi, I have a simple entity:
    Ent(val id: Long?) : Persistable<Long?>
    . This of course requires to implement
    getId
    and
    isNew
    . But when I try to implement
    getId
    I have Platform declaration clash error; if I don't implement it, I have Class Ent must be declared abstract or implement abstract method error. What's the correct way to do this?
    u
    s
    • 3
    • 9
  • u

    123

    06/23/2017, 4:26 PM
    for russian-speaking it could be noteworthy new Kotlin extensions in Spring5

    https://www.youtube.com/watch?v=tBnRIZkVg-Q▾

    o
    n
    • 3
    • 6
  • p

    poohbar

    06/27/2017, 10:50 PM
    seems like BasicAuth and then using JSESSIONID in a cookie may work fine
    a
    • 2
    • 1
  • n

    nklmish

    06/28/2017, 12:34 PM
    I have
    org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M2
    in my classpath
    c
    • 2
    • 5
  • n

    nklmish

    06/28/2017, 6:42 PM
    Did anyone tried
    spring-boot-gradle-plugin-2.0.0.M2
    , seems to be missing
    SpringBootPluginExtension
    ?
    c
    • 2
    • 1
  • n

    nklmish

    07/05/2017, 8:26 AM
    Thank you @sdeleuze for your contribution to the community 🙂
    ⬆️ 4
    s
    • 2
    • 1
  • x

    x80486

    07/05/2017, 2:10 PM
    Now that I see this one...is there any way to use the
    kotlin-spring
    plugin, but be able to close some classes then "by hand" then? For instance, not all Spring beans/classes need to be "open"; an example could be a "controller" class (that doesn't feature, for instance, any
    @Transactional
    annotation). In that case, it's totally possible to have that just like that, but if I use
    @Controller
    it will be opened by default because of the
    kotlin-spring
    plugin.
    n
    s
    • 3
    • 6
  • d

    dh44t

    07/06/2017, 1:05 PM
    on Spring 5 you can use it whit functions
    s
    • 2
    • 1
  • h

    hhariri

    07/07/2017, 5:53 AM
    @sdeleuze did? I’m sorry I missed it then 😕
    s
    • 2
    • 1
  • j

    jk

    07/08/2017, 6:32 PM
    @ziad I think it might be a limitation of the spring inspection - there are legitimately multiple DataSource implementations on the classpath if you use Spring boot autoconfiguration because it conditionally selects it based on your application config. The IDE could arguably figure it out and not display the warning, but I'd imagine that would be a feature request you'll have to raise
    👍 1
    y
    • 2
    • 1
  • r

    roberto.guerra

    07/11/2017, 5:07 PM
    just asking out of curiosity, started using
    kobalt
    and I like it better than
    gradle
    so far.
    n
    o
    c
    • 4
    • 4
  • a

    arocnies

    07/14/2017, 3:44 AM
    I'm having some trouble with a relatively simple SpringBoot + Kotlin example. An Autowired var fails at runtime despite intellij properly detecting the dependency is fulfilled.
    s
    p
    • 3
    • 3
  • z

    ziad

    07/16/2017, 3:40 PM
    Hi again 🙂 Anyone with thoughts on this?
    o
    • 2
    • 7
  • m

    minus

    07/17/2017, 6:12 PM
    Hello, I'm attempting to change Java 8 code to Kotlin, which includes changing field-based injection to constructor-based injection, but Spring is throwing me errors about missing default constructors. This isn't exactly a problem Kotlin specifically because it also fails when trying in Java, but maybe there's a trick to it that someone here knows. (Spring 4.2.6, Spring Boot 1.3.5)
    n
    a
    +2
    • 5
    • 8
Powered by Linen
Title
m

minus

07/17/2017, 6:12 PM
Hello, I'm attempting to change Java 8 code to Kotlin, which includes changing field-based injection to constructor-based injection, but Spring is throwing me errors about missing default constructors. This isn't exactly a problem Kotlin specifically because it also fails when trying in Java, but maybe there's a trick to it that someone here knows. (Spring 4.2.6, Spring Boot 1.3.5)
n

nayanjyoti

07/17/2017, 6:17 PM
@minus : are the constructor based injections annotated with
@Autowired
m

minus

07/17/2017, 6:17 PM
in kotlin yes, in java it complained that @Autowired wasn't allowed with parameters
a

agomez

07/17/2017, 6:25 PM
did you added the
constructor
keyword as explained here https://kotlinlang.org/docs/reference/annotations.html#usage ?
m

minus

07/17/2017, 6:39 PM
ah yep, putting the annotation on the constructor instead of with the args (no compiler error on kotlin?) makes it work, thanks, @agomez @nayanjyoti
n

nfrankel

07/17/2017, 8:15 PM
@Autowired
on constructors is not required since latest versions of Spring try without 🙂
n

nerses

07/17/2017, 8:16 PM
@nfrankel it will require an upgrade to spring 4.3
@minus is using (Spring 4.2.6, Spring Boot 1.3.5)
n

nfrankel

07/17/2017, 8:49 PM
@nerses ok
View count: 3