Reference Application - Vagrant Setup Error

Application Name: Reference Application Version Number: 2.0

Question: I set up my development environment as instructed at the GitHub repo using Vagrant.

mvn clean package succeeds without errors. But running vagrant up throws a maven build error within the guest VM. Specifically, a checksum mismatch comes up due to a plugin being not available at the path the guest VM checks. This happens for the org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom and the build stops there. The packaging process correctly downloads the plugin and adds it to local maven repo. Then the guest VM checks this file against the one it tries to download from the following path:

https://openmrs.jfrog.io/openmrs/public/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom

This location returns a 404 response and thus the checksum mismatch.

The complete log of running vagrant up can be found here:

http://pastebin.com/USaNpjFC

How should I go about fixing this?

By the way did you get a chance to look at this? https://wiki.openmrs.org/display/docs/OpenMRS+SDK

Yes, I was able to successfully run a server through the SDK previously. I see that we can also deploy a packaged distro from any folder. Tried that with this build and it works too, thank you :slight_smile:

Is the Vagrant error due to outdated files in the given virtual machine image?

This will give you some more background information: https://issues.openmrs.org/browse/TRUNK-5108 In the light of this talk thread remove Vagrantfile and puppet in openmrs-core we decided as you see above.

Do you think we were too fast to do this? Do you feel like the SDK and docker path is not enough for your use case?

Thank you, but isn’t that about the OpenMRS Core?

Anyone looking to fix a Reference App issue would go the way I went. Newcomers, like me, might follow the instructions at the Reference App’s GitHub repo and the wiki page. This means they’ll get stuck too. The wiki page and the Readme of the GitHub repo need to be updated to reflect the new deploying mechanisms. Shall I do that?

I wouldn’t say it’s too fast. But it hasn’t been fully documented so it’s confusing.

1 Like

Yes please go ahead and update the documentation. Thank you so much for taking the lead on this! :smile:

1 Like

Glad to help! :slight_smile: Shall I first open an issue for this for archival purposes?

Yes go ahead and open one. Thanks again :slight_smile:

1 Like

I’ve been testing possible methods of setting up a dev environment for the Reference Application with local builds and so far I’ve come up with the following;

  1. OpenMRS SDK Setup server with platform version Build RA from GitHub sources Manually copy modules from the built distro to server modules folder in openmrs at User Account root.
  2. With Tomcat Build RA from GitHub sources Copy built openmrs platform from distro to Tomcat Webapps folder Copy modules from the built distro to server modules folder in .OpenMRS (note the difference in folders) at User Account root.

Deploying with Tomcat throws up a UI Framework error as shown here.

I suspect the following methods are also possible, but haven’t been able to test them with my limited knowledge as a newcomer.

  1. Build server and run it offline with locally built Ref App through SDK.

I would like to know how to achieve this last method and whether I am missing any other mechanisms.

Especially, I could not find instructions on how to run a local build of Ref App on top of a server from SDK in one command. If I understood correctly, the method mentioned here by @darius sets up a Ref App instance with data fetched from remote repositories.

As for the error you are getting, i suspect that you are using the snapshot version of platform. This will result into errors until all the REST resources add support for it. The solution therefore is that you used a released version of the platform.

Have you explored the openmrs standalone as another option? https://wiki.openmrs.org/display/docs/OpenMRS+Standalone

Strangely, the error did not come with the snapshot version of the platform. :open_mouth:

Maybe I didn’t make myself clear enough. The aim is to develop the Reference Application - like work on a ticket, do development work, and then test whether the changes work. This is not to try out the Reference Application - it’s to develop the Ref App itself. Not its modules either, since most modules have their own repo.

OpenMRS Standalone is to try the Ref App, is it not? It’s not meant to be used for development.

Though the standalone can also be used for development, it is obviously easier to use the SDK in that case. :slight_smile:

1 Like

Chanuka, when developing RA you basically setup a server using the latest SNAPSHOT version of RA. Call openmrs-sdk:setup, choose distribution and select Reference Application 2.6-SNAPSHOT.

Next you add modules you will be changing to the list of watched modules for that server. It means that whenever you startup the server, those modules will be built from source and deployed to the server. See watching projects.

In addition if you make any changes in the web layer by modifying controllers, gsps, js files, etc. they will be deployed instantly without having to restart the server.

Hope that helps.

It would be good to add RA development setup to https://wiki.openmrs.org/display/docs/OpenMRS+SDK+Step+By+Step+Tutorials

@dkayiwa I’ll look into how the Standalone can be used for development. Seems it’ll need some manual file swapping. :slight_smile: For now I’ll just add a reference to the SDK from the RA distro Repo’s Readme file, then.

@raff Thank you for the great explanation, solidified what I learned from the Wiki! The instant deploying feature is quite useful. Quick question, how would one test a change to a file like this?

@merovingienne, it’s a UI test, thus that code is not deployed to the server. It can be executed against a running server. See https://github.com/openmrs/openmrs-distro-referenceapplication#running-ui-tests-locally

Happy to help. Could you please add setting up for the RA development to the Step by Step Tutorials page I linked above?

Understood, thanks! That was an example, but since there isn’t much else other than UI tests in the ref app distro repository, there’s usually nothing one would need to change in that repo I suppose.

Of course, I will gladly add these instructions;

I updated the Wiki page, please check for any errors.