Open suranjanabasu opened 5 years ago
Did you try to override internal beans ? By changing configuration ?
spring: main: allow-bean-definition-overriding: true
Fixed here
api group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.1'
This bug is still happening with api group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.1'
Expected Behavior
Expecting to connect to both mysql and dynamodb. The connections work individually, but not together I also followed suggestions described here: https://github.com/derjust/spring-data-dynamodb/issues/127 But after doing the above, dynamodb throws a mapping error
Actual Behavior
The bean 'dynamoDB-DynamoDBMapperConfig', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.
Steps to Reproduce the Problem
Use "spring-boot-starter-data-jpa" within dependecies Create some repos for MySQL entities Create a DynamoDBTable entity Create DynamoDBConfig class Create DynamoDB Crude Repository Start the app
Here is my code:
@Configuration @EnableJpaRepositories(includeFilters = { //or use basePackages or excludeFilters @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {UserRepository.class}) }) @EnableDynamoDBRepositories(includeFilters = { //or use basePackages or excludeFilters @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {KeysRepository.class}) }) public class DynamoDBConfig {
}
@SpringBootApplication @EnableJpaRepositories(includeFilters = { //or use basePackages or excludeFilters @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {UserRepository.class}) }) @EnableDynamoDBRepositories(includeFilters = { //or use basePackages or excludeFilters @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {KeysRepository.class}) }) public class Application {
}
@EnableScan public interface KeysRepository extends CrudRepository<Keys, String> { List findByKey(String key);
}
@Data @DynamoDBTable(tableName = "keys") public class Keys implements Serializable { @DynamoDBHashKey private String key;
}
@Repository public interface UserRepository extends JpaRepository<User, String> {
}
Specifications
All those information are logged by
org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory
onINFO
level on startup. Or usejava -version
andmvn dependency:tree | grep -E 'spring|aws'
to provide those version numbers.