Hello,
I created my first module named “patientdetails” . I then configured spring mvc .
And now configuring hibernate throws an server error 500…
I created service, serviceImpl, dao and daoImplclasses and added bean according to Module Application Context File - Documentation - OpenMRS Wiki in the /omod/src/main/resources/webModuleApplicationContext.xml but its throws eror when deploying the module. At first it shows EntityManger closed.Error is
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.openmrs.module.patientdetails.service.PatientdetailsService' available: expected single matching bean but found 2: patientdetailsServiceImpl,patientdetails.PatientdetailsService which is about the bean configurations in your moduleApplicationContext
Thanks @gcliff , @dkayiwa , @sharif and @mozzy …Have been able to save data in database
Error solved
All in all Module Application Context File already when created it has already set up beans
By default, the moduleApplicationContext.xml will do for you the required SpringConfiguration for the default service class and the hibernate layer classes.
Any Spring error that shows up is most probably caused by some thing else ,
So you ddnt have to tamper with the moduleApplicationContext.xml configurations