Unable to update data model using liquibase.xml. Module: EMR API Module

@mozzy you can do this:

mvn openmrs-sdk:setup -DserverId=openmrs-custom-distro -Ddistro=./openmrs-custom-distro.properties
  -DdbUri=jdbc:mysql://localhost:3306/openmrs_custom_distro -DdbUser=root -DdbPassword=pass

The relevant part is about the -Ddistro argument. You can launch a custom server based on whatever you decide to configure in the custom config. file openmrs-custom-distro.properties.


Note that for the sake of the example I have assumed

  • That openmrs-custom-distro.properties is where you launch the SDK command.
  • That you have MySQL 5.6 running on port 3306.
  • That the MySQL root credentials are root/pass.

thx @mksd. now is that going to just set up anew server? or a cleanup of the current problem?

here is my current openmrs-distro.properties

#Thu Jun 28 03:18:38 MDT 2018
db.h2.supported=false
db.sql=classpath\://openmrs-distro.sql
name=Reference Application
omod.addresshierarchy=2.11.0
omod.adminui=1.2.3
omod.allergyui=1.8.1
omod.appframework=2.11.0
omod.appointmentscheduling=1.9.0
omod.appointmentschedulingui=1.7.0
omod.appui=1.8.0
omod.atlas=2.2
omod.atlas.type=omod
omod.calculation=1.2
omod.chartsearch=2.1.0
omod.coreapps=1.19.0
omod.dataexchange=1.3.2
omod.emrapi=1.24.4
omod.event=2.6.0
omod.event.groupId=org.openmrs
omod.fhir=1.13.0
omod.formentryapp=1.4.2
omod.htmlformentry=3.7.0
omod.htmlformentryui=1.7.0
omod.htmlwidgets=1.9.0
omod.idgen=4.5.0
omod.legacyui=1.4.0
omod.metadatadeploy=1.10.0
omod.metadatamapping=1.3.4
omod.metadatasharing=1.5.0
omod.owa=1.9.0
omod.providermanagement=2.10.0
omod.referenceapplication=2.8.0
omod.referencedemodata=1.4.4
omod.referencemetadata=2.8.0
omod.registrationapp=1.12.0
omod.registrationcore=1.8.0
omod.reporting=1.16.0
omod.reportingcompatibility=2.0.5
omod.reportingrest=1.10.0
omod.reportingui=1.6.0
omod.serialization.xstream=0.2.14
omod.serialization.xstream.type=omod
omod.uicommons=2.6.0
omod.uiframework=3.13.0
omod.uilibrary=2.0.6
omod.webservices.rest=2.22.0
owa.openmrs-owa-sysadmin=1.1
version=2.9.0-SNAPSHOT
war.openmrs=2.1.3

wat is exactly wrongā€¦

@mksd and @dkayiwaā€¦ i cant figure out y the websevices.rest cant start

With the method I suggested you could easily start a server that looks like a Ref App 2.9.0-SNAPSHOT, but with Core 2.2.0-SNAPSHOT.

But what setup do you actually need to achieve?

1 Like

i want to test the some emr api module whether it can do data migrationā€¦and i need platform 2.2.0

btw , how do i stop /re-start sdk server via commandline. am tired of just restarting the computer @mksd @dkayiwa

ok let ne try that command

i did this

mvn openmrs-sdk:setup -Ddistro=referenceapplication:2.9.0-SNAPSHOT -Dplatform=2.2.0-SNAPSHOT

and i thout it wud setup a server running with reff application on platform 2.2.0 but it only built a platform on 2.2.0

If I understand correctly you are up to some work on the tip of EMR APIā€™s master branch and you also want the latest Core. So those two are in development under the following versions:

  • EMR API: 1.25.0-SNAPSHOT (see here),
  • Core: 2.2.0-SNAPSHOT (see here).

So I guess that what you want to do is start from the openmrs-distro.properties of the Ref App 2.9.0-SNAPSHOT and up those two versions, leading to this below (pay attention to those two below in the list):

db.h2.supported=false
db.sql=classpath\://openmrs-distro.sql
name=Reference Application
omod.addresshierarchy=2.11.0
omod.adminui=1.2.3
omod.allergyui=1.8.1
omod.appframework=2.11.0
omod.appointmentscheduling=1.9.0
omod.appointmentschedulingui=1.7.0
omod.appui=1.8.0
omod.atlas=2.2
omod.atlas.type=omod
omod.calculation=1.2
omod.chartsearch=2.1.0
omod.coreapps=1.19.0
omod.dataexchange=1.3.2
omod.emrapi=1.25.0-SNAPSHOT
omod.event=2.6.0
omod.event.groupId=org.openmrs
omod.fhir=1.13.0
omod.formentryapp=1.4.2
omod.htmlformentry=3.7.0
omod.htmlformentryui=1.7.0
omod.htmlwidgets=1.9.0
omod.idgen=4.5.0
omod.legacyui=1.4.0
omod.metadatadeploy=1.10.0
omod.metadatamapping=1.3.4
omod.metadatasharing=1.5.0
omod.owa=1.9.0
omod.providermanagement=2.10.0
omod.referenceapplication=2.8.0
omod.referencedemodata=1.4.4
omod.referencemetadata=2.8.0
omod.registrationapp=1.12.0
omod.registrationcore=1.8.0
omod.reporting=1.16.0
omod.reportingcompatibility=2.0.5
omod.reportingrest=1.10.0
omod.reportingui=1.6.0
omod.serialization.xstream=0.2.14
omod.serialization.xstream.type=omod
omod.uicommons=2.6.0
omod.uiframework=3.13.0
omod.uilibrary=2.0.6
omod.webservices.rest=2.22.0
owa.openmrs-owa-sysadmin=1.1
version=2.9.0-SNAPSHOT
war.openmrs=2.2.0-SNAPSHOT

Save this as the content of the following new file: /tmp/openmrs-custom-distro.properties.

Then run

mvn openmrs-sdk:setup -DserverId=custom-distro -Ddistro=/tmp/openmrs-custom-distro.properties -DdbUri=jdbc:mysql://localhost:3306/openmrs_lfhc-distro -DdbUser=root -DdbPassword=pass

Where you should obviously replace ā€˜passā€™ by your MySQL root password. Answer the usual questions, in particular pick Java 8 when asked for it. Then run the server:

mvn openmrs-sdk:run -Dport=8080 -DserverId=custom-distro

Note that I have no idea whether Ref App 2.9.0ā€™s modules will be ok against Core 2.2.xā€¦

To stop the server just hit CTRL+C in the terminal window where you typed the last command.

ok thx, lllet me try that.

though about ctr + c , the server actualy doesnt stop, it only closes the window but i realised the server remains working in the background

Actually about the EMR-api, the commits am working are not yet merged. so as long as i can get a refference application on platform 2.2.0, there am good to go.

am i supposed to give a full path to the properties file

ā€œā€¦/tmp/ā€¦ā€??

ok ive created it, let me see whether it will run succesfully

ive created it , but it has also produced the same results

You must have done something wrong there. I just did some trials and you need both Core 2.2.0-SNAPSHOT and EMR API 1.25.0-SNAPSHOT together for this modified Ref App 2.9.0-SNAPSHOT to startup.

And yet, it wonā€™t quite startup, I stumbled upon an error that the Ref App module wouldnā€™t start, this is the stack trace then:

java.lang.RuntimeException: failed to setup the required modules
	at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.started(ReferenceApplicationActivator.java:112)
	at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:927)
	at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:847)
	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:632)
	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:612)
	at org.openmrs.web.Listener.startOpenmrs(Listener.java:251)
	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
Caused by: java.lang.NullPointerException
	at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.mapMetadata(ReferenceApplicationActivator.java:146)
	at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.setupEmrApiGlobalProperties(ReferenceApplicationActivator.java:127)
	at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.started(ReferenceApplicationActivator.java:98)
	... 6 more

So the problem happens here in the Ref App moduleā€™s activator. This is a place where the Ref App module relies on EMR API, so one would need to debug to understand what exactly goes wrong. @dkayiwa, just in case you would have any idea?


Apart from that everything else could start. But, because of the Ref App module that could not start, Reference Demo Data and Reference Metadata could not start either.

If youā€™re using Windows like me then ctrl+c doesnā€™t work since the sdk actually forks out a new process for running the server.

I got around this by either

  • manually killing the process (you can view living java processes with the jps command, the forked process is usually named Launcher)
  • Starting the server without forking a new process: mvn openmrs-sdk:run -Dfork=false (now ctrl+c will kill the server as expected)
4 Likes

thx @nthfloor

@nthfloor thx nuch, it greatly solved my problems , otherwise , i was just retarting my PC to stop the sdk server :sunglasses: