new to OSGI.
I use spring-boot in OSGI. In bundle activator, spring-boot application starts up successfully. I have a component class as below
@Service // spring-boot annotation
@Component(immediate = true) // osgi annotation
public class Test {
@Activate
public void activate() {
System.out.println("osgi component activated");
}
@Reference
public void set(ServiceComponentXXX a) {
System.out.println("reference got");
}
The class Test only binds services and are not binded by any other. The class ServiceComponnetXXX is from other bundle. the activate and set methods are never executed.
After remove spring-boot annotation @Service, code works fine. so the question is that can a class be both a spring-boot component and an OSGI component?