I want to setup the reference application modules in my local environment. So, I downloaded the platform and the modules from here. When I start the server and hit http://localhost:8080/openmrs/ it gives me the below exception.
I have not mixed up the module versions. I just simply downloaded both the platform and the modules.
The legacy-module which came with the bundle was legacyui-1.2.3.omod
I cloned the legacy-ui and built it. Its version was legacyui-1.2.4-SNAPSHOT.omod
I copied the .omod to my %AppData%\modules folder and restarted the Tomcat. It worked.
Problem seems to be like at the initial loading of my Tomcat server, it didn’t identified taglib file…
The problem has nothing to do with the bundled legacyui module. You can confirm this by reverting to it instead of the new one and you will see that all is well. It is just that you left IRC without pinging me but i was about to tell you that the answer was simply a restart of tomcat.
"A note on TLD scanning: In Tomcat 7 and earlier the TLD scanning happens twice,
first, at startup time, to discover listeners declared in tld files (done by TldConfig class),
second, by JSP engine when generating java code for a JSP page (done by TldLocationsCache)."
In later versions (>7), the second scan is not performed which is why, after the modules are extracted into the webapp’s WEB-INF/view/module directory, a second scan is required.
I stand to be corrected but that I believe is the reason why.
I know this is 3 years later at this point, but I just want to say thanks to @benb123 for the insights in his post, as the changes to how Tomcat loads TLDs in Tomcat 8+ does appear to be the cause of this issue.
Basically, in Tomcat 8+, Taglibs are scanned at startup at a time that pre-dates the OpenMRS startup process that unpacks module TLDs into WEB-INF/view/<module_id>/<path-to-tld>.tld, and no further TLD scanning is done (which is different from the behavior in Tomcat 7, which scanned for TLDs at the time a JSP page is compiled as well).