Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeanDefinitionOverrideException in the JpaConfig #5349

Closed
c-schuler opened this issue Oct 4, 2023 · 1 comment
Closed

BeanDefinitionOverrideException in the JpaConfig #5349

c-schuler opened this issue Oct 4, 2023 · 1 comment
Assignees
Labels

Comments

@c-schuler
Copy link
Contributor

Describe the bug

I am trying to use the hapi-fhir-jpaserver-starter project with v6.9.9-SNAPSHOT of hapi-fhir. When building, I am seeing the following exception:

Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'helperSvc' defined in class path resource [ca/uhn/fhir/jpa/config/JpaConfig.class]: 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.config.JpaConfig; factoryMethodName=helperSvc; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [ca/uhn/fhir/jpa/config/JpaConfig.class]] for bean 'helperSvc': There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=ca.uhn.fhir.jpa.config.MdmJpaConfig; factoryMethodName=helperSvc; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [ca/uhn/fhir/jpa/config/MdmJpaConfig.class]] bound.

This is due to the "helperSvc" bean being defined twice.
In the JpaConfig here: https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/JpaConfig.java#L875-L878

And in the imported config from MdmJpaConfig here: https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/MdmJpaConfig.java#L53-L56

To Reproduce
Steps to reproduce the behavior:

  1. Clone the hapi-fhir-jpaserver-starter project.
  2. Change the parent version to 6.9.9-SNAPSHOT
  3. Run mvn package
  4. See error

Expected behavior
No build errors.

Environment (please complete the following information):

  • HAPI FHIR Version 6.9.9-SNAPSHOT
  • OS: Apple M1 Pro, MACOS Ventura 13.4.1
@c-schuler
Copy link
Contributor Author

Resolved in #5350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant