Background : I have two projects, proj A and proj B. Now, in proj A i have a cache.xml file , a java bean(say customer bean), a repository class(RecordRepository). I am loading the repository class in the cache.xml
Cache.xml
</gfe:client-region>
<!--Scan for annotated GemFire Repositories-->
<gfe-data:repositories base-package="cache.repository" />
In proj B, I import the jar of proj A and then try to load the bean and the repository. My goal is to create an object of customer bean and then call the repository class to save the customer bean.
Employee emp = (Employee)facilityCacheLoader.getRegionBean();
emp.setRecordId("2001");
emp.setRecordString("record string 2002");
// update the Bean and save
RecordRepository rep = (RecordRepository)facilityCacheLoader.getRepository();
rep.save(emp);
But I am getting the following exception:
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cache.repository.RecordRepository] is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:296) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125) at com.rxc.cacheclient.CacheLoaderClient.main(CacheLoaderClient.java:40)