# .omod Generated Crashing Standalone

**URL:** <https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838>\
**Category:** Development\
**Created:** [October 23, 2017, 3:21pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838 "2017-10-23T15:21:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 23, 2017, 3:21pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/1 "2017-10-23T15:21:37Z")

</div>

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.

 ![11](https://talk.openmrs.org/uploads/default/original/2X/e/e3ac6f89282872ee9335cc360d77c2a367b81c5e.png)

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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 23, 2017, 3:37pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/2 "2017-10-23T15:37:57Z")

</div>

Can you paste the server log at [pastebin.com](http://pastebin.com)?

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 23, 2017, 3:52pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/3 "2017-10-23T15:52:14Z")

</div>

@dkayiwa.

Please note this link to the log. [https://pastebin.com/v8mXVPvL](https://pastebin.com/v8mXVPvL)

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 23, 2017, 4:02pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/4 "2017-10-23T16:02:24Z")

</div>

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](http://pastebin.com)

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 23, 2017, 6:09pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/5 "2017-10-23T18:09:44Z")

</div>

@dkayiwa

I have done as above.

Note this log [https://pastebin.com/p73P35pr](https://pastebin.com/p73P35pr) .

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 23, 2017, 7:09pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/6 "2017-10-23T19:09:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![willa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/willa/32/256_2.png) [@willa](https://talk.openmrs.org/u/willa)\
**Post date:** [October 23, 2017, 7:12pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/7 "2017-10-23T19:12:17Z")

</div>

FWIW I was working on an angular directive defined in [uicommons module](https://github.com/openmrs/openmrs-module-uicommons) 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)

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 23, 2017, 7:27pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/8 "2017-10-23T19:27:08Z")

</div>

@dkayiwa

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.

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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 23, 2017, 7:41pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/9 "2017-10-23T19:41:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 24, 2017, 2:51pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/10 "2017-10-24T14:51:57Z")

</div>

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

@gayanw could it be caused by your previous commits?

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 24, 2017, 2:53pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/11 "2017-10-24T14:53:03Z")

</div>

@dkayiwa

Well noted. Thanks.

---

<div class="post-metadata">

**Author:** ![gayanw](https://talk.openmrs.org/letter_avatar/gayanw/32/5_5575768a8748004e209b776fc1b2916d.png) [@gayanw](https://talk.openmrs.org/u/gayanw)\
**Post date:** [October 24, 2017, 3:40pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/12 "2017-10-24T15:40:21Z")

</div>

@dkayiwa @niccieThe errors shown in the screenshot have nothing to do with the standalone being crashed. The errors showing are due to [undocumented resources](https://wiki.openmrs.org/display/docs/Documenting+REST+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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 24, 2017, 7:46pm UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/13 "2017-10-24T19:46:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gayanw](https://talk.openmrs.org/letter_avatar/gayanw/32/5_5575768a8748004e209b776fc1b2916d.png) [@gayanw](https://talk.openmrs.org/u/gayanw)\
**Post date:** [October 25, 2017, 4:02am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/14 "2017-10-25T04:02:08Z")

</div>

I mean the swagger errors showing up in the picture can’t be relevant 🙂 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.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 25, 2017, 8:11am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/15 "2017-10-25T08:11:13Z")

</div>

@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](https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm)

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 25, 2017, 8:39am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/16 "2017-10-25T08:39:24Z")

</div>

@gayanw @dkayiwa

Sorry for the late reply.

@gayanwI 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.

---

<div class="post-metadata">

**Author:** ![gayanw](https://talk.openmrs.org/letter_avatar/gayanw/32/5_5575768a8748004e209b776fc1b2916d.png) [@gayanw](https://talk.openmrs.org/u/gayanw)\
**Post date:** [October 25, 2017, 9:05am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/17 "2017-10-25T09:05:09Z")

</div>

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.

[https://pastebin.com/iWVWJw7i](https://pastebin.com/iWVWJw7i)

@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.

[https://wiki.openmrs.org/display/docs/Documenting+REST+Resources](https://wiki.openmrs.org/display/docs/Documenting+REST+Resources)

There are already issues open for these:

> <https://issues.openmrs.org/browse/RESTWS-681>

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

---

<div class="post-metadata">

**Author:** ![niccie](https://talk.openmrs.org/user_avatar/talk.openmrs.org/niccie/32/5520_2.png) [@niccie](https://talk.openmrs.org/u/niccie)\
**Post date:** [October 25, 2017, 9:11am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/18 "2017-10-25T09:11:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 25, 2017, 9:13am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/19 "2017-10-25T09:13:11Z")

</div>

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

> [@Google Code-In Application Updates](https://talk.openmrs.org/t/google-code-in-application-updates/13863):
>
> The application period ended yesterday and Google will announce accepted organizations tomorrow. We currently have 14 mentors. If you are interested in mentoring and haven’t signed up yet, please sign up using this short 3 minutes form [https://goo.gl/forms/AHtqYb9N5UrREd7K2](https://goo.gl/forms/AHtqYb9N5UrREd7K2) We had over 150 tasks which where mostly from previous gci years. These tasks don’t cover all categories yet. GCI tasks can fall under one of the following categories Coding (No task for this category yet) Documentation /…

---

<div class="post-metadata">

**Author:** ![gayanw](https://talk.openmrs.org/letter_avatar/gayanw/32/5_5575768a8748004e209b776fc1b2916d.png) [@gayanw](https://talk.openmrs.org/u/gayanw)\
**Post date:** [October 25, 2017, 9:17am UTC](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838/20 "2017-10-25T09:17:30Z")

</div>

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

[Next page](https://talk.openmrs.org/t/omod-generated-crashing-standalone/13838.md?page=2)
