Application Name: Platform
Version Number: 2.0.5
I have a problem with loading my module, OpenHMIS Cashier, into OpenMRS. When I load it, I get the following error.
The ultimate cause is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cashierLogoutFilter' is defined.
See below for my setup and what I’ve tried, but does anyone know anything, or what, I’m doing wrong? The class is decorated with the
@Component annotation and Spring can see it from my context file.
For some background, I’m in the process of updating this module to use platform 2.0.5. Other’s have had problems with this module (openHMIS module’s settings page error) and I’ve already included those fixes.
I believe the problem comes from using a filter (defined in the
config.xml of the OMOD submodule) that is using
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>. You can view the code repository on Git and the file if you wish. Loading the OMOD in platform 1.11.7 works fine. It’s only in 2.0.5 that the error is thrown.
I’ve tried moving the filter class around, specifically defining the bean in the
webModuleApplicationContext.xml file, and even moving the definitions to a
web.xml file in a WEB-INF folder. This last option enables the module to load, but no filters get registered for the module and the code in the filter does not execute. I’ve also tried defining listeners (
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>) in the files, in addition to referencing
<context-param> nodes to put the reference
Any suggestions or thoughts would be appreciated. Also, you will not be able to compile the code and pull it from the repository to do your own testing at the moment. I’m in the process of updating each of this module’s dependencies to platform 2.0.5.