the qualifier does not seem to be taken into consi...
# spring
d
the qualifier does not seem to be taken into consideration…
l
can you try using @Qualifier, or maybe renaming the variable to jaxWsClientBus
d
tried both - same outcome
I suspect something about inheritance?
l
how about @field:Qualifier
d
If I do
Copy code
class SecurityConfig(@Autowired @Qualifier("jaxWsClientBus") bus: Bus) : AbstractJaxWsClientStubConfig(bus) {
it works
but that’s a bit annoying
l
did you try
@field:Qualifier("jaxWsClientBus")
?
d
then i get `expected annotation identified after ':'``
ait
it should be in an array
YES!
we have a winner
Copy code
@field:[Qualifier("jaxWsClientBus") Inject]
    protected lateinit var bus: Bus
thanks a lot!
l
np. but wouldnt
Copy code
@field:Qualifier("jaxWsClientBus")
    protected lateinit var bus: Bus
work?
d
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property bus has not been initialized
nope
l
ah, sorry. you also need @Autowired or @Inject
if that does not work, you will also need field: prefix
and then it leads to your array-style use, which is new to me. i always use annotaions separately
just out of curiosity, i did a few experiments, and found out that only @Named must have the
field:
prefix. so the bare minimum that works can be:
Copy code
@Inject
@field:Named("jaxWsClientBus")
or
Copy code
@Autowired
@Qualifier("jaxWsClientBus")
@Inject and @Autowired are interchangeable