spring boot scanning and injecting external non-spring beans

What does it take, or is it even possible for Spring to scan and inject non-spring annotated classes? For example.



com.project.resource.StandardResource <-- concrete implementation

@Singleton <--- Standard CDI annotation

public class StandardResource implements ResourceInterface{


public void something(){}


Now let's say I have a spring boot application which depends on resource.jar.


@SpringBootApplication(scanBasePackages = {"com.project"})


public class SpringApp{

... initializer


private ResourceInterface resourceService; <--- this is not found


Is this supposed to work out of the box? Is this even possible? I'm using spring boot 2.0.0.RELEASE. I'm getting the following error:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating...

Read More »

By: StackOverFlow - Friday, 13 April

Related Posts