https://kotlinlang.org logo
Title
s

s1m0nw1

02/28/2019, 1:52 PM
When I see two instances of the same
object
in my application, what might be the issue? Seems to be possible
g

ghedeon

02/28/2019, 1:55 PM
Just guessing, but could it be from the different process?
s

s1m0nw1

02/28/2019, 1:56 PM
That was also my guess, but it really seems to be the same
it's a spring boot application fwiw
multi module
n

natpryce

02/28/2019, 1:59 PM
Could be Spring creating “beans” by using reflection to invoke private constructors. JUnit 5 has the same bug.
s

s1m0nw1

02/28/2019, 2:00 PM
yeah something like that. I can see it's being initialized during startup and once again later
h

hho

02/28/2019, 2:00 PM
Different classloaders maybe?
s

s1m0nw1

02/28/2019, 2:01 PM
@sdeleuze any known issues with
object
?
oh I think I have an idea thanks @hho
you're definitely right, it's being loaded twice with two different classloaders
maybe it's not a known issue because this particular object is being used during the spring init already, which might not be the common scenario
d

Davio

02/28/2019, 3:30 PM
Classloading issues can happen when Devtools is enabled
Found that out the hard way
s

s1m0nw1

02/28/2019, 3:30 PM
Removed them already, not the issue
No you're actually right 🤦‍♂️ I removed them only partially
s

sdeleuze

02/28/2019, 5:30 PM
I have not played that much with
object
yet, I mostly used it with Exposed.