Bean of the repository defined in the dependency jar file is not creating when the main application starts

49 Views Asked by At

Hi I am new to Springboot,

I have 2 Springboot applications,

  1. DSM
  2. saveDataAPI

DSM is used to handle all the DB related interactions.

in DSM I have,

  1. component class
  2. Repository - uses CouchbaseRepository
  3. Entity

component has a save() method which is used to save an entity to the to couchBase DB. DSM was build as a jar and it was included in saveDataAPI. Added the component class details in the META-INF file in DSM so that saveDataAPI can access it.

META_INF_File

I have injected the dependency of DSM's component class in saveDataAPI'2 service class to use the save function. I couldn't see any compilation error and also the maven build was success.

@Autowired DSMController dsmController;

But as I try to run saveDataAPI in eclispe, I am getting the below error.

Action:

Consider defining a bean of type 'com.ums.sam.DSMModule.repo.DSMMRepository' in your configuration.

DSMRepository is autowired to DSM's component class but as saveDataAPI starts, it is unable to create the bean.

Can someone please suggest a way to resolve this.

Thank you.

0

There are 0 best solutions below