Spring instantiation error on the 'uiUtils' bean

Hi all,

I’m currently working on adding a context sensitive test to the htmlformentryui module for the <obsFromFragment/> tag components. This tag’s element internally depends on UiUtils or to be more specific here, BasicUiUtils.

The issue I’m facing is, I’m failing to autowire the Spring bean in my test environment with the error :point_right: https://pastebin.com/yUkku2e1

I have throwaway work branch for others to follow what exactly I have done to configure the bean: see commit. Defining the bean in the TestingApplicationContext.xml file is sufficient enough for the error to showup.

For this case, I had this:

<bean id="conversionService" class="org.openmrs.module.uiframework.UiFrameworkConversionServiceFactoryBean"/>
<bean id="uiUtils" class="org.openmrs.ui.framework.BasicUiUtils" init-method="init"/>

I see attachments works fine without the problem, see: https://github.com/openmrs/openmrs-module-attachments/blob/fb128fe79aab64ba0055cf424a1b7f78bbb9b5ab/api/src/test/resources/TestingApplicationContext.xml#L7

What could I be missing?

/cc: @mksd, @dkayiwa

Do you have a pull request with your changes?

Here: https://github.com/openmrs/openmrs-module-htmlformentryui/compare/master...samuelmale:scratch-pad

Add this dependency to the pom.xml file in the omod: https://pastebin.com/LRa487EM

2 Likes

Thanks @dkayiwa. Adding the dependency resolves the issue.