Skip to content
Advertisement

Is there a way to @Autowire non overridden methods?

I have an interface that is implemented by multiple classes, and these classes also have some extra methods. If I autowire the class. Is there a way I can autowire these extra methods?

Example-

Interface

JavaScript

Service 1

JavaScript

Service 2

JavaScript

If I try to directly Autowire the service like this-

JavaScript

then I am getting error something like this-

JavaScript

Advertisement

Answer

I was using @ConditionalOnProperty on the services, that is why it was not getting autowired.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement