I have come to realise that there is a popular error developers have been facing while hacking OpenMRS which is:
org.openmrs.api.Context.APIException: A user context must first be passed to setUserContext()…use Context.openSession() and (closeSession() to prevent memory leaks!) before using the API."
I want to write a Blog Article on this problem ie: possible causes and solutions to each case. @michael suggested I could use gist on github for this. I am currently exploring the threads on this error and any suggestions from the Developer community and possible causes and solutions will be greatly appreciated. I’ll publish the link to the Blog post to the community once I’ve taken everyone’s suggestions.