With the recent upgrade to Spring 5, one problem that has arisen is that the DefaultAnnotationHandlerMapping class has been removed from Spring MVC. This class has been deprecated since Spring 3.2 in favour of the RequestMappingHandlerMapping, but is still used extensively throughout our community modules. We should therefore migrate our code to no longer make use of this class.
OpenMRS seems to use DefaultAnnotationHandlerMapping in two ways:
1. In some instances, it's simply defined as a bean in the corresponding webModuleApplicationContext.xml like this:
In these instances, the mapping should be removed from the webModuleApplicationContext.xml and inserted into a Spring Configuration class in the Omod, similar to what was done in this commit. At a minimum, this class should contain:
2. In other instances, DefaultAnnotationHandlerMapping is used directly in code, albeit primarily in tests. In these cases, we should investigate whether the code is necessary and if it is whether it can be successfully swapped for an implementation using RequestMappingHandlerMapping.
For some background see this Talk thread