Scheduled tasks failing because bahmnicore module not loaded yet?

Hello, I am working through rolling out an install of bahmni 0.91. My first goal is to have a good install of bahmni with the existing database data from 0.90, and then to pull in some customization and modification from our site. I’ve tried to follow the online directions, however the installed bahmni has had a number of errors. I’m trying to work through things a bit at a time to try to have a clean and stable build.

At first I was getting many errors which I think were related to cyclical dependencies:

WARN - AbstractBeanFactory.getTypeForFactoryBean(1427) |2019-05-30 
13:58:16,877| Bean creation exception on FactoryBean type check: 
org.springframework. beans.factory.BeanCreationException: Error 
creating bean with name 'bedTagMapService' defined in URL [
jar:file:/opt/openmrs/.openmrs-lib-cache/bedmanagement/lib/
bedmanagement-api-5.8.1.jar!/moduleApplicationContext.xml]: Cannot 
resolve reference to bean 'bedTagMapServiceImpl' while setting 
bean property 'target'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'bedTagMapServiceImpl' defined in URL [
jar:file:/opt/openmrs/.openmrs-lib-cache/bedmanagement/lib/
bedmanagement-api-5.8.1.jar!/moduleApplicationContext.xml]: Cannot 
resolve reference to bean 'bedTagMapDao' while setting bean 
property 'dao'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'bedTagMapDao' defined in URL [
jar:file:/opt/openmrs/.openmrs-lib-cache/bedmanagement/lib/
bedmanagement-api-5.8.1.jar!/moduleApplicationContext.xml]: Cannot 
resolve reference to bean 'sessionFactory' while setting bean 
property 'sessionFactory'; nested exception is org.springframework.
beans.factory.BeanCurrentlyInCreationException: Error creating 
bean with name 'sessionFactory': FactoryBean which is currently in 
creation returned null from getObject    

I got around this by creating an OpenMRS server using OpenMRS SDK, cloning and building the openmrs-distro-bahmni.git, and then combining these to have an openmrs system with bahmni modules that would start without these errors. This involved replacing the .war and .omod files in the installed bahmni system, and then also copying over the /opt/openmrs/openmrs directory.

Now the system seems to start up alright, but I am trying to work through the error messages in openmrs.log to deal with any issues. I am looking at this one:

ERROR - OpenElisPatientFailedEventsFeedClientImpl.processFailedEvents(79) |2019-06-03 11:51:16,238|     openelisatomfeedclient:failed feed execution while r
unning failed eventsjava.lang.NullPointerException
java.lang.NullPointerException
	at org.bahmni.module.bahmnicore.properties.BahmniCoreProperties.getProperty(BahmniCoreProperties.java:28)
	at org.bahmni.module.elisatomfeedclient.api.ElisAtomFeedProperties.getPatientFeedUri(ElisAtomFeedProperties.java:19)
	at org.bahmni.module.elisatomfeedclient.api.client.impl.OpenElisPatientFailedEventsFeedClientImpl.getFeedUri(    OpenElisPatientFailedEventsFeedClie
ntImpl.java:49)
	at org.bahmni.module.elisatomfeedclient.api.client.OpenElisFeedClient.createAtomFeedClient(OpenElisFeedClient.java:55)
	at org.bahmni.module.elisatomfeedclient.api.client.OpenElisFeedClient.getAtomFeedClient(OpenElisFeedClient.java:49)
	at org.bahmni.module.elisatomfeedclient.api.client.impl.OpenElisPatientFailedEventsFeedClientImpl.processFailedEvents(    OpenElisPatientFailedEvent
sFeedClientImpl.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
	at com.sun.proxy.$Proxy287.processFailedEvents(Unknown Source)
	at org.bahmni.module.elisatomfeedclient.api.task.OpenElisPatientFeedFailedEventsTask.execute(    OpenElisPatientFeedFailedEventsTask.java:13)
	at org.openmrs.scheduler.tasks.TaskThreadedInitializationWrapper.execute(TaskThreadedInitializationWrapper.java:67)
	at org.openmrs.scheduler.timer.TimerSchedulerTask.execute(TimerSchedulerTask.java:94)
	at org.openmrs.api.context.Daemon$2.run(Daemon.java:135)

I believe this may be because the bahmnicore module isn’t started until later:

INFO - ModuleActivator.started(13) |2019-06-03 11:51:19,715| Started the Bahmni Core module

Does this seem right? If so maybe the failed atomfeed events will probably be processed later, so this might not be an issue. But it would be nice if there weren’t java errors showing up in the log file.

Thanks

Can you disable the scheduler startup at the beginning? Once the modules are all started, then go to the admin console and restart the schedulers.

I got similar error as depicted here.

I was able to disable all schedulers except the ones that are related to OpenElis. When I try to disable and save I get the the following error:

Class [org.bahmni.module.elisatomfeedclient.api.task.OpenElisPatientFeedFailedEventsTask] could not be found. Check war file and/or modules for class [org.bahmni.module.elisatomfeedclient.api.task.OpenElisPatientFeedFailedEventsTask].