hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
356 stars 977 forks source link

v7.0.3, v7.0.2, v7.0.0 releases completely fail to start in R5 mode. #675

Closed preston closed 2 months ago

preston commented 2 months ago

All the v7.0 release tags -- namely v7.0.3, v7.0.2, and v7.0.0. -- released on Docker Hub completely failure to start in R5 mode due to the error,

The bean 'subscriptionQueryValidator', defined in ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig, could not be registered. A bean with that name has already been defined in class path resource [ca/uhn/fhir/jpa/topic/SubscriptionTopicConfig.class] and overriding is disabled.

The complete error message is:

docker run -it --rm -p 8080:8080 -e hapi.fhir.fhir_version=R5 hapiproject/hapi:v7.0.3
Unable to find image 'hapiproject/hapi:v7.0.3' locally
v7.0.3: Pulling from hapiproject/hapi
Digest: sha256:73ff82fec42e5cbb7e66338d47af09ba91c140e98beeaee41a5459572d5ae1ce
Status: Downloaded newer image for hapiproject/hapi:v7.0.3

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.0)

2024-04-05 23:27:08.778 [background-preinit] INFO  o.h.validator.internal.util.Version [Version.java:21] HV000001: Hibernate Validator 8.0.0.Final
2024-04-05 23:27:08.843 [main] INFO  ca.uhn.fhir.jpa.starter.Application [StartupInfoLogger.java:50] Starting Application using Java 17.0.10 with PID 1 (/app/main.war started by nonroot in /app)
2024-04-05 23:27:08.843 [main] INFO  ca.uhn.fhir.jpa.starter.Application [SpringApplication.java:653] No active profile set, falling back to 1 default profile: "default"
2024-04-05 23:27:09.513 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate [RepositoryConfigurationDelegate.java:139] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2024-04-05 23:27:09.648 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate [RepositoryConfigurationDelegate.java:208] Finished Spring Data repository scanning in 125 ms. Found 53 JPA repository interfaces.
2024-04-05 23:27:09.669 [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext [AbstractApplicationContext.java:632] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'subscriptionQueryValidator' defined in ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig; factoryMethodName=subscriptionQueryValidator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig] for bean 'subscriptionQueryValidator' since there is already [Root bean: class [null]; scope=; abstract=false; lazyInit=true; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=ca.uhn.fhir.jpa.topic.SubscriptionTopicConfig; factoryMethodName=subscriptionQueryValidator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [ca/uhn/fhir/jpa/topic/SubscriptionTopicConfig.class]] bound.
2024-04-05 23:27:09.677 [main] INFO  o.s.b.a.l.ConditionEvaluationReportLogger [ConditionEvaluationReportLogger.java:82] 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-04-05 23:27:09.693 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter [LoggingFailureAnalysisReporter.java:40] 

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'subscriptionQueryValidator', defined in ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig, could not be registered. A bean with that name has already been defined in class path resource [ca/uhn/fhir/jpa/topic/SubscriptionTopicConfig.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
preston commented 2 months ago

FYI @swantrace

jkiddo commented 2 months ago

@preston see https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/655

jkiddo commented 2 months ago

Closed with workaround in #655