Problem in running the application

Hi, I have tried to do an OpenMrs installation from scratch in a Windows7 64 bit machine and below are the steps that I have done

  1. Installed My SQL server with default port 3306 and created a user root with
  2. Installed Apache Tomcat Version 7.0.70
  3. Installed Eclipse Neon IDE
  4. Downloaded the source openmrs-core source code from GitHub - openmrs/openmrs-core: OpenMRS API and web application code
  5. Did a maven install using Eclipse and command used was -X clean install -DskipTests=true
  6. This resulted in openmrs.war created in D:\Java Coding and development\git\openmrs-core\webapp\target

Attempt to run it on Tomcat 7. Started the Tomcat server from windows command prompt using startup.bat after navigating to the Tomcat bin directory 8. Opened browser and navigated to http://localhost:8080 and tomcat launch page obtained 9. logged into manager console 10. Tried to upload and deploy openmrs.war obtained in step 6 Nothing happened and tomcat page displayed uploading 0% in bottom left corner (in Chrome) and hang.


Attempt to run it on Jetty 11. Stopped the Tomcat server 12. Run the command jetty:run through Eclipse IDE 13. Opened browser and navigated to http://localhost:8080 and Jetty gave a message to go to Openmrs initial setup 14. Did the initial setup and lots of liquibase xml files get executed and console showed msgs similar to below INFO 7/18/16 8:19 PM:liquibase: ChangeSet liquibase-update-to-latest.xml::20121113-TRUNK-3474-person-attribute-type::patandre ran successfully in 747ms . . INFO 7/18/16 8:22 PM:liquibase: Successfully released change log lock [INFO] Initializing Spring root WebApplicationContext WARN - SimpleUrlHandlerMapping.registerHandlers(115) |2016-07-18 20:22:55,320| Neither ‘urlMap’ nor ‘mappings’ set on SimpleUrlHandlerMapping WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2109) |2016-07-18 20:22:55,332| Unable to find a runtime properties file at D:\Java Coding and development\git\openmrs-core\webapp\openmrs-runtime.properties WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2137) |2016-07-18 20:22:55,333| Unable to find properties file: C:\Users\458228\Application Data\OpenMRS\openmrs-runtime.properties WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2109) |2016-07-18 20:22:55,335| Unable to find a runtime properties file at D:\Java Coding and development\git\openmrs-core\webapp\openmrs-runtime.properties WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2109) |2016-07-18 20:22:55,336| Unable to find a runtime properties file at D:\Java Coding and development\git\openmrs-core\webapp\openmrs-runtime.properties WARN - Listener.loadBundledModules(516) |2016-07-18 20:22:55,346| Bundled module folder doesn’t exist: D:\Java Coding and development\git\openmrs-core\webapp\src\main\webapp\WEB-INF\bundledModules WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2109) |2016-07-18 20:22:55,346| Unable to find a runtime properties file at D:\Java Coding and development\git\openmrs-core\webapp\openmrs-runtime.properties

INFO 7/18/16 8:22 PM:liquibase: Reading from liquibasechangelog WARNING 7/18/16 8:22 PM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case WARNING 7/18/16 8:22 PM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case WARNING 7/18/16 8:22 PM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case WARN - OpenmrsUtil.applyLogLevel(590) |2016-07-18 20:22:56,037| Global property is invalid. Valid values are trace, debug, info, warn, error or fatal INFO - LoggingAdvice.invoke(115) |2016-07-18 20:22:57,566| In method UserService.savePrivilege. Arguments: Privilege=Manage Providers, INFO - LoggingAdvice.invoke(155) |2016-07-18 20:22:57,645| Exiting method savePrivilege … … … WARN - SimpleUrlHandlerMapping.registerHandlers(115) |2016-07-18 20:23:15,454| Neither ‘urlMap’ nor ‘mappings’ set on SimpleUrlHandlerMapping INFO - ServiceContext.doneRefreshingContext(827) |2016-07-18 20:23:15,458| Done refreshing Context WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2109) |2016-07-18 20:23:15,885| Unable to find a runtime properties file at D:\Java Coding and development\git\openmrs-core\webapp\openmrs-runtime.properties

Now navigating to http://localhost:8080/openmrs/index.htm gives me the following screen

Any help how I can get the same screen as when I launch the standalone application will be appreciated. I would like to confirm that all tables have been created in openmrs schema in mysql database and I can query tables from my My sql workbench.

Warm Regards, Sattam

You are seeing this because you are running the code from the master branch, which is just the platform (hence no UI).

If you want to see the same thing as the standalone or demo server, then you need to run the Reference Application. Download the WAR file and Modules using the grey download buttons here (not the orange button).

Hi @sattam,

As @pascal said, if the mvn install was run on the default branch of the Platform repo (master), it means that you built the Platform 2.0+ which is headless (no UI). This is what the ‘no use interface module is installed’ message is hinting at.

This is not the Platform version used in the standalone edition (yet). The latest release of the standalone edition is made of two things:

  1. Platform 1.11.6 You have Platform 2.0
  2. Reference Application distro 2.4 You don’t have that.

If you want to setup a dev environment for those two things I would recommend the use of the OpenMRS SDK. You would have the whole server to debug a few commands away with a total control on the Platform and Ref App distro versions.

I hope this helps.

1 Like

Thank you @pascal and mksd

Is there anything that will work with platform 2.0. I understand is headless but is there any module that is there which is capable of running on top of this 2.0 that I may download and run. If no then I will try the 11.6 with reference application 2.4 if yes then I would like to know if there is any instructions available for that.

It depends what your priority is.

If you just need the latest UI, then you should definitely go down the route of Platform 1.11.6 + Ref App distro 2.4. This is the latest release anyway and that is what you were looking at when you were using the standalone edition.

If you require Platform 2.0, then I am not sure where the Ref App distro modules stand with it. I would assume that we are long way from having them compatible with Platform 2.0.

Dimitri thanks again for your quick reply. I would then prefer to get the Source code of Platform 1.11.6 rather than the war file. I intend to build it myself.

There is even a specific tag for it:

cd .../openmrs-core
git checkout 1.11.6
mvn clean install

And on the other hand you can use the SDK to get the server up & running, specifying 1.11.6 for the Platform version.

Good luck.

Hi @mksd,

Checked out the 1.11.x version from Git and build and deployed on Tomcat. OpenMrs deployed all fine with running status as true. However on navigatin to http://localhost:8080/openmrs/initialsetup it appears as below.

Here is the log generated <logtext localhost.2016-07-20.log Jul 20, 2016 3:33:14 PM org.apache.catalina.core.ApplicationContext log INFO: Shutting down log4j Jul 20, 2016 3:33:14 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextDestroyed() Jul 20, 2016 3:33:14 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextDestroyed() Jul 20, 2016 5:07:35 PM org.apache.catalina.core.ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath Jul 20, 2016 5:07:36 PM org.apache.catalina.core.ApplicationContext log INFO: Set web app root system property: ‘webapp.root’ = [D:\Softwares\apache-tomcat-7.0.70\webapps\openmrs] Jul 20, 2016 5:07:36 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [classpath:log4j.xml] Jul 20, 2016 5:07:45 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jul 20, 2016 5:07:45 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jul 20, 2016 5:07:45 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: attributeAdded(‘org.apache.jasper.compiler.TldLocationsCache’, ‘org.apache.jasper.compiler.TldLocationsCache@73afc4b8’) Jul 20, 2016 5:46:29 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextDestroyed() Jul 20, 2016 5:46:29 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextDestroyed() Jul 20, 2016 5:46:29 PM org.apache.catalina.core.StandardContext listenerStop SEVERE: Exception sending context destroyed event to listener instance of class org.openmrs.web.Listener org.openmrs.api.APIException: contextDAO is null at org.openmrs.api.context.Context.getContextDAO(Context.java:169) at org.openmrs.api.context.Context.closeSession(Context.java:776) at org.openmrs.web.Listener.contextDestroyed(Listener.java:550) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5146) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5810) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1587) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1576) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Jul 20, 2016 5:46:29 PM org.apache.catalina.core.ApplicationContext log INFO: Shutting down log4j Jul 20, 2016 5:47:30 PM org.apache.catalina.core.ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath Jul 20, 2016 5:47:30 PM org.apache.catalina.core.ApplicationContext log INFO: Set web app root system property: ‘webapp.root’ = [D:\Softwares\apache-tomcat-7.0.70\webapps\openmrs] Jul 20, 2016 5:47:30 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [classpath:log4j.xml] Jul 20, 2016 5:47:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Jul 20, 2016 5:47:35 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jul 20, 2016 5:47:35 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: attributeAdded(‘org.apache.jasper.compiler.TldLocationsCache’, ‘org.apache.jasper.compiler.TldLocationsCache@4c946252’) logtext/>

I found ContextDAO.class in {Openmrs_home}\api\target\classes\org\openmrs\api\db and is of size 2kb.

Restarted the tomcat Removed work and temp directory from tomcat Restarted Tomcat Get same error [TRUNK-4234] and [TRUNK-734] did not helped much either.

Any clue or guidance will be help!

P.S: I was wondering that the satandalone version has one openmrs-standalone-runtime.properties file which had the connection.username ,connection.url, connection.password mentioned which I could not find anywhere in the tree below {Openmrs_home}\ . Not sure if this is of any problem thought worth mentioning.

I don’t think I can help you with the above as I am completely unfamiliar with Windows, I don’t even have anything at hand to reproduce your steps.

Once again, if your goal is simply to have a dev env up & running, I strongly suggest you to use the OpenMRS SDK. As you can see below, you may be 3 commands away from your goal. ####0) Setup the SDK:

mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

####1) Create your server:

mvn openmrs-sdk:setup -DserverId=distro-2-4 -Ddistro=referenceapplication:2.4 -DdbUri=jdbc:mysql://localhost:3306/openmrs-distro-2-4 -DdbUser=root -DdbPassword=pass

This assumes that MySQL

  • is running on port 3306 ;
  • with root admin credentials being ‘root’ / ‘pass’.

####2) Launch it:

 mvn openmrs-sdk:run -Dport=8080 -Ddebug=58080 -DserverId=distro-2-4

If all goes well you will then be in a position to access the app on port 8080 and remote debug it on port 58080. Let us know how this goes.

P.S. More on the latest release of the SDK here: OpenMRS SDK 3.0 released! and on YouTube.

1 Like

This kind of liquibase error happens usually when switching between different OpenMRS versions in a dev environment. The easiest way to fix it is to remove the OpenMRS completely and start with a fresh one.

which JDK are you using . such errors often arise when using jdk 8. incase your using 8 then switch to 7

Hi @lluismf I discarded the previous build. Cloned the 1.11.x afresh from github. Build it alright. Build was successful. Deployed it on Tomcat.

The initial set up got completed followed by updation of database. However after the completion the address changed to http://localhost:8080/openmrs/index.htm?lang=en and the screen became white. Now when I am navigating to http://localhost:8080/openmrs/initialsetup

I am getting the below error.

The username and password provided during the intial set up is not working. I checked the users table in the database and the values in password filed is 4a1750c8607d0fa237de36c6305715c223415189 value in salt field is c788c6ad82a157b712392ca695dfcf2eed193d7f

openmrs.user_role table contains rows as below

mysql> SELECT * FROM openmrs.user_role;
+---------+------------------+
| user_id | role             |
+---------+------------------+
|       1 | Provider         |
|       1 | System Developer |
+---------+------------------+
2 rows in set (0.00 sec)

mysql>

I could not find any other reason for this problem

Warm Regards, Sattam

Dear All, Apologies if any of my helpful friend is trying to work on it. I was using a password Admin123, while I should have used the password test

Thank you for your help and support!

Warm Regards, Sattam

1 Like