Issue 3804 application fails to start 610 pre14 snapshot with beandefinitionoverrideexception invalid bean definition with name loadidsstep (#3805)

* shared steps

* Add changelog

Co-authored-by: leif stawnyczy <leifstawnyczy@leifs-MacBook-Pro.local>
Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
This commit is contained in:
jmarchionatto 2022-07-19 10:00:28 -04:00 committed by GitHub
parent 592190701c
commit 67e67bbf44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 17 deletions

View File

@ -0,0 +1,5 @@
---
type: fix
issue: 3804
title: "When starting hapi-fhir from starter application, BeanDefinitionOverrideException was thrown with message: Invalid bean
definition with name loadIdsStep. This issue is now fixed."

View File

@ -0,0 +1,15 @@
package ca.uhn.fhir.batch2.jobs.config;
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SharedCtx {
@Bean
public LoadIdsStep loadIdsStep(IBatch2DaoSvc theBatch2DaoSvc) {
return new LoadIdsStep(theBatch2DaoSvc);
}
}

View File

@ -22,9 +22,9 @@ package ca.uhn.fhir.batch2.jobs.expunge;
import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson;
import ca.uhn.fhir.batch2.jobs.chunk.ResourceIdListWorkChunkJson;
import ca.uhn.fhir.batch2.jobs.config.SharedCtx;
import ca.uhn.fhir.batch2.jobs.parameters.UrlListValidator;
import ca.uhn.fhir.batch2.jobs.step.GenerateRangeChunksStep;
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class DeleteExpungeAppCtx {
public class DeleteExpungeAppCtx extends SharedCtx {
public static final String JOB_DELETE_EXPUNGE = "DELETE_EXPUNGE";
@ -87,11 +87,6 @@ public class DeleteExpungeAppCtx {
return new GenerateRangeChunksStep();
}
@Bean
public LoadIdsStep loadIdsStep(IBatch2DaoSvc theBatch2DaoSvc) {
return new LoadIdsStep(theBatch2DaoSvc);
}
@Bean
public DeleteExpungeProvider deleteExpungeProvider(FhirContext theFhirContext, IDeleteExpungeJobSubmitter theDeleteExpungeJobSubmitter) {
return new DeleteExpungeProvider(theFhirContext, theDeleteExpungeJobSubmitter);

View File

@ -23,10 +23,10 @@ package ca.uhn.fhir.batch2.jobs.reindex;
import ca.uhn.fhir.batch2.api.IJobCoordinator;
import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson;
import ca.uhn.fhir.batch2.jobs.chunk.ResourceIdListWorkChunkJson;
import ca.uhn.fhir.batch2.jobs.config.SharedCtx;
import ca.uhn.fhir.batch2.jobs.parameters.UrlListValidator;
import ca.uhn.fhir.batch2.jobs.parameters.UrlPartitioner;
import ca.uhn.fhir.batch2.jobs.step.GenerateRangeChunksStep;
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ReindexAppCtx {
public class ReindexAppCtx extends SharedCtx {
public static final String JOB_REINDEX = "REINDEX";
@ -67,6 +67,11 @@ public class ReindexAppCtx {
.build();
}
@Bean
public GenerateRangeChunksStep reindexGenerateRangeChunksStep() {
return new GenerateRangeChunksStep();
}
@Bean
public ReindexJobParametersValidator reindexJobParametersValidator(IBatch2DaoSvc theBatch2DaoSvc) {
return new ReindexJobParametersValidator(new UrlListValidator(ProviderConstants.OPERATION_REINDEX, theBatch2DaoSvc));
@ -77,15 +82,7 @@ public class ReindexAppCtx {
return new ReindexStep();
}
@Bean
public GenerateRangeChunksStep reindexGenerateRangeChunksStep() {
return new GenerateRangeChunksStep();
}
@Bean
public LoadIdsStep loadIdsStep(IBatch2DaoSvc theBatch2DaoSvc) {
return new LoadIdsStep(theBatch2DaoSvc);
}
@Bean
public ReindexProvider reindexProvider(FhirContext theFhirContext, IJobCoordinator theJobCoordinator, IRequestPartitionHelperSvc theRequestPartitionHelperSvc, UrlPartitioner theUrlPartitioner) {