title: Spring Boot (or mvc), OSGI integration : Dynamically creating objects for dynamic OSGI modules
body: <p>I have a requirement to load dynamic modules on a Spring Boot Microservice. i.e Assume I have a MicroService called ProductService that will create different kind of products. And assume that I want to dynamically add products so there I use OSGI product modules. </p>
  
  <p>So if I add ProductXYZ as a OSGI module and how can I call a method on that module via Spring boot REST API. i.e
  /products/id/description?name=ProductXYZ </p>
  
  <p>Here the issue is, in Spring Boot (even Spring web MVC) these rest calls are handle in the controller. And to get description of ProductXYZ I should create an object of ProductXYZ in the controller. But when coding the controller class it is impossible to call "new ProductXYZ()" as we don't have ProductXYZ when coding controller. We have ProductXYZ in later after we add osgi ProductXYZ module. </p>
  
  <p>Thanks. </p>