Unable to get Service contexts

Hello there

I have been working with OpenMRS(v2.0.1 ) for nearly five months now and there is an issue that keeps popping up every now and then. The issue is regarding the Injection of Beans. As restart the server many a times a couple of services are not found.

I have tried using the following in my java controllers: 1. @SpringBean("beanName") 2. Context.getService(beanName.class)

Further I have also tried to use <scope>provided</scope> in the pom.xml

But there is no guarantee that I have the code is stable. Most recently I have re-faced this issue for JasperReportService in the jasperreports module.

Please help me out.

Can you paste the full log at pastebin.com?

Is your service registered with the service context in the moduleApplicationContext.xml file?

Here it is https://pastebin.com/XgHdg0z8

Yes it is. The problem is resolved if I restart the server a couple of times. But this may not be the best if the solutions.

This does not contain the full log.