I’m struggling with a migration task of a custom module for MDR-TB initially built for Openmrs 1.6 (Ant build.xml, SQLDiff, JDK6, i.e. the really old and retired stuff). Here’s what I did so far:
Replaced the openmrs-api.jar and openmrs-web.jar to version 1.9, and make necessary updates to DAO and Services.
Remove SQLDiff entirely (planning to move to liquibase).
Built the module using Ant build and deployed manually on a running instance.
After getting rid of obvious errors, I’m out of clues with this error log
Apparently, the module activator isn’t launching. I tried implementing Activator as well as extended BaseModuleActivator.
Here’s my config file config file and the moduleApplicationContext.xml
Hi @owais.hussain looks like there are a number of different errors happening there. Without seeing the code, I’d recommend you double check that the right classes are in the omod project and in the api project, and that the omod is including the api as a dependency.
Bigger picture, I don’t know what module this is, but it seems like it might be a fork of the mdrtb module. The original mdrtb module was migrated to run on OpenMRS 1.9.x and to use Maven long ago, so I’d recommend comparing what you are doing to the master branch (and commit history) of the mdrtb module codebase here: GitHub - openmrs/openmrs-module-mdrtb: OpenMRS MDR-TB module
Thanks a bunch @mseaton. I searched on Addons for “MDRTB”. Found it now when I used “MDR”. Anyways, I was able to pull the module and get it to work after rebuilding.
@mseaton I’m trying to get it to work on v1.9.1 (spring 3). Actually I’m writing the test suite for API which didn’t exist for the module before. I’m trying to use spring annotations and auto-wiring.
The module works fine without the annotations as long as the DAO and Service setters are enabled.
Hi @owais.hussain - I see. Yes, the module AFAIK, should already work on a 1.9 environment. Presumably you have specific reasons why you are trying to introduce component and service annotations and autowiring in the service and dao, but this not something that is typically done in my experience, and in some cases can dramatically slow down system startup performance.
If you are trying to introduce tests into the API layer, I’d recommend looking at other modules that are built against a minimum 1.9 version, and try to set things up the same way. For example, you may want/need to move the moduleApplicationContext.xml file into the api layer, and split the web components off into a webModuleApplicationContext.xml file in the omod layer, etc.
Right. I browsed HFE and Reporting modules and didn’t find any annotations. Thanks for updating me on the performance issues. I’ll try to split the application context.