Error during getting registered component

Hi, I am working on FHIR Module. I am trying to implement compatibility to support different openmrs versions and am stuck with this error:

Caused by: org.openmrs.api.APIException: Error during getting registered component.
at org.openmrs.api.context.ServiceContext.getRegisteredComponent(
at org.openmrs.api.context.Context.getRegisteredComponent(
at org.openmrs.module.fhir.api.util.ContextUtil.getConditionHelper(
at org.openmrs.module.fhir.api.strategies.condition.ConditionStrategy.createFHIRCondition(
at org.openmrs.module.fhir.api.impl.ConditionServiceImpl.createFHIRCondition(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(
at org.springframework.cache.interceptor.CacheAspectSupport.execute(
at org.springframework.cache.interceptor.CacheInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.openmrs.aop.LoggingAdvice.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
at com.sun.proxy.$Proxy187.createFHIRCondition(Unknown Source)
at org.openmrs.module.fhir.resources.FHIRConditionResource.createFHIRCondition(

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'fhir.ConditionHelper' is defined
at org.openmrs.api.context.ServiceContext.getRegisteredComponent(

In All of the api sub-module. I have registered to the context with the same name “fhir.ConditionHelper”

@Component(value = "fhir.ConditionHelper")
@OpenmrsProfile(openmrsPlatformVersion = "2.2.* ")
public class ConditionHelperImpl2_2 implements ConditionHelper {

Below is the link to PR (Work in Progress) with all changes made.

Need help figuring out what am doing wrong or haven’t?

Which OpenMRS platform version are you running?

Openmrs platform 2.2

Add another dependency for fhir-api-2.2 like this one:

I added fhir-api-2.2 dependency to the omod didn’t work, still the same error

Did you commit that change?

No I haven’t

While I was debugging I found this method:


yet I specify global property property in the config file:

	<description>Set condition strategy</description>

There is something I am missing out. It seems can’t neither register to the Context nor retrieve from! :frowning:

@dkayiwa help me figure this

Have you committed your changes yet?

Yes. I have committed.

What is the exact version of the OpenMRS platform as it appears in the footer of your browser?

Version 2.2.0

I have just compiled your changes and installed the module on platform 2.2.x with out any errors. You may need to cross check again?

I am getting the error when i tried to access the condition endpoint. I have no problem deploying. it does successful. But when I try accessing the endpoint I have exposed. It throws the error above.

What is the exact end point?

POST request to: /openmrs/ws/fhir/Condition

sample body

    "resourceType": "Condition",
    "id": "92A45BE7A93A4E14A49CB9A51E19C3A4",
    "subject": {
      "reference": "Patient/D1A903924D4443A7A388778D77D86155"
    "clinicalStatus": "active",
    "code": {
      "coding": {
        "system": "",
        "code": "236578006",
        "display": "Chronic rejection of renal transplant (disorder)"
      "text": "Chronic rejection of renal transplant (disorder)"
    "onsetDateTime": "2011-12-31"

Change the package of the ConditionHelperImpl2_2 class from helper to org.openmrs.module.fhir.helper

Thanks @dkayiwa it worked. I never considered checking for package my bad :frowning_face: