Open yozaner1324 opened 2 years ago
Failure: The bean 'Person' could not be registered. A bean with that name has already been defined and overriding is disabled.
The bean 'Person' could not be registered. A bean with that name has already been defined and overriding is disabled.
Scenario: This occurs when a class extends a data class annotated with @Region, even if the subclass is not used.
@Region
Example:
@Region("Person") class Person{ @Id private String name; public Person(String name) { this.name = name; } public String getName() { return name; } } class Customer extends Person { public Customer(String name) { super(name); } }
If Customer doesn't extend Person, there is no issue, but if it does, the application context will fail to load.
Customer
Person
Work arounds:
spring.main.allow-bean-definition-overriding
Repo reproducing issue: https://github.com/yozaner1324/SBDG-using-sealed-classes
TODO: Move to Spring Data for Apache Geode (SDG) Issues since the @EnableEntityDefinedRegions annotation is specific to Spring Data Geode.
@EnableEntityDefinedRegions
Failure:
The bean 'Person' could not be registered. A bean with that name has already been defined and overriding is disabled.
Scenario: This occurs when a class extends a data class annotated with
@Region
, even if the subclass is not used.Example:
If
Customer
doesn't extendPerson
, there is no issue, but if it does, the application context will fail to load.Work arounds:
spring.main.allow-bean-definition-overriding
to trueRepo reproducing issue: https://github.com/yozaner1324/SBDG-using-sealed-classes