Я работаю над проектом по реализации функции обратной совместимости в разных версиях приложения. У меня есть подмодули, как вы можете видеть на изображении ниже:
И я застрял с этой ошибкой:
Caused by: org.openmrs.api.APIException: Error during getting registered component.
at org.openmrs.api.context.ServiceContext.getRegisteredComponent(ServiceContext.java:901)
at org.openmrs.api.context.Context.getRegisteredComponent(Context.java:1201)
at org.openmrs.module.fhir.api.util.ContextUtil.getConditionHelper(ContextUtil.java:31)
at org.openmrs.module.fhir.api.strategies.condition.ConditionStrategy.createFHIRCondition(ConditionStrategy.java:31)
at org.openmrs.module.fhir.api.impl.ConditionServiceImpl.createFHIRCondition(ConditionServiceImpl.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:303)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy187.createFHIRCondition(Unknown Source)
at org.openmrs.module.fhir.resources.FHIRConditionResource.createFHIRCondition(FHIRConditionResource.java:69)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'fhir.ConditionHelper' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:694)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:962)
at org.openmrs.api.context.ServiceContext.getRegisteredComponent(ServiceContext.java:898)
In Все из подмодуля API. Я зарегистрировался в контексте с тем же именем
fhir.ConditionHelper
@Component(value = "fhir.ConditionHelper")
Кажется, я не могу ни зарегистрироваться в контексте приложения, ни получить зарегистрированные компоненты :(