.omod Generated Crashing Standalone

Hello Everyone,

I have completed working on a Java task but facing an issue with generating a .omod file. Every time I upload a newly generated .omod file it crashes my standalone.

I am not sure what I am facing here. I have even tried re-cloning the repository and even using the new 2.6.1 standalone version but still fails to be successful.

Please assist.

sample omod https://drive.google.com/a/andela.com/file/d/0B2C7fOrkWvS1dm1iVlNKZUN1QkE/view?usp=sharing

Can you paste the server log at pastebin.com?


Please note this link to the log. https://pastebin.com/v8mXVPvL

This does not look like the full contents of your log file.

  1. Stop the standalone
  2. Delete the logs folder
  3. Start the standanlone up to the point of reproducing the error and then paste the contents of the log file at pastebin.com


I have done as above.

Note this log https://pastebin.com/p73P35pr .

Which module are you compiling that crashes your openmrs? And does openmrs run well if you remove that module?

FWIW I was working on an angular directive defined in uicommons module and every time I upload the omod to standalone 2.6.1 I was not able to access the patient dashboard. Restarting the standalone solved the issue. (Sorry, I didn’t even bother to understand the error)


I am trying to upload a Rest Web Services OMOD.

On removing the module, it still does not resolve it and some of the other modules stop and when I restart them they throw errors.

@willa Restarting seems to solve the issue but the api documentation module still has the error in screenshot above.

If you discard your local changes in the module and compile again, does it work?

@niccie do not worry, i was able to reproduce it here: https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm

@gayanw could it be caused by your previous commits?


Well noted. Thanks.

@dkayiwa @niccie The errors shown in the screenshot have nothing to do with the standalone being crashed. The errors showing are due to undocumented resources, as we have enabled validation in the swagger-ui. These errors can be ignored.

Reference application seems to still use webservices.rest version: 2.16 But most my changes are introduced, in later versions.

Can you also provide with an error log without your .omod.

I see this in the error log. Not sure if it is helpful.

java.lang.IllegalStateException: Servlets can not be added to context /openmrs-standalone as the context has been initialised

@gayanw she was using the snapshot version of the rest webservices module.

I mean the swagger errors showing up in the picture can’t be relevant :slight_smile: The crash has to be due to something else.

I just tried running 2.22.0-SNAPSHOT version of webservices.rest module on reference application 2.7.0-SNAPSHOT. And there was no errors.

I didn’t try the standalone version. May be there are other ways to reproduce.

@gayanw ignore the word crash. I think she simply did mean the above screenshot. What would you suggest as the way forward to resolve these errors? https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm

@gayanw @dkayiwa

Sorry for the late reply.

@gayanw I granted you access to the .omod.

As Daniel has replied in above, we can first look into those errors.

I also downloaded and tried with the latest Rest .omod file and it works just fine with no errors. Therefore errors seems to be with .omod snapshot.

Yes. I too tried your omod and I could reproduce the same error. May be it is to do with the changes you made to that omod.


@dkayiwa, In the Swagger UI upgrade we enabled spec validation. So a quick hack is to disable it. But I think the ideal solution will be to document these undocumented resources. I have already wrote a Wiki page on this.


There are already issues open for these:

These actually are tasks and not bugs. I’m thinking of opening tasks for each resource. So these swagger validation errors will disappear.

Probably or I installed some unwanted stuff in my eclipse when working on it.

Since it was only for two files and the PR was merged, do you mind pulling the changes and generate a .omod on your end?

@gayanw do you think those are small and simple enough to be good GCI coding tasks?

Yes, I think they are simple enough as there is no much logic to it. Understanding Swagger model classes will be good enough.