英文:
Why ReflectionEntityInformation when using Composite key of DynamoDB in Spring Boot
问题
错误可能出在Spring Data DynamoDB依赖版本的兼容性上。根据你的日志,看起来问题出在找不到org.springframework.data.repository.core.support.ReflectionEntityInformation
类。为了解决这个问题,你可以尝试以下几个步骤:
-
检查Spring Data DynamoDB版本: 确保你使用的Spring Data DynamoDB版本与你的Spring Boot版本兼容。你可以在Spring Data DynamoDB的文档或者官方仓库中找到关于版本兼容性的信息。
-
更新依赖版本: 如果版本不兼容,尝试升级或者降级Spring Data DynamoDB版本,以便与你的Spring Boot版本匹配。
implementation 'org.springframework.boot:spring-boot-starter-data-dynamodb'
-
清理和构建: 在你的项目目录下运行以下命令,确保所有依赖被正确下载并且项目被正确构建。
./gradlew clean build
-
检查依赖冲突: 在你的项目中可能存在依赖冲突。你可以运行以下命令来检查依赖关系:
./gradlew dependencies
确保没有多个版本的Spring Data DynamoDB库被引入。
-
检查@EnableDynamoDBRepositories注解: 确保在
AwsDynamoDbConfig
类上使用了@EnableDynamoDBRepositories
注解,并且basePackages
属性指向了你的Repository包路径。@Configuration @EnableDynamoDBRepositories(basePackages = "com.mukit09.dynamodblearning.repository") public class AwsDynamoDbConfig { // 配置内容... }
-
考虑删除
@EnableScan
注解: 如果你的MusicRepository
接口不需要扫描整个表,可以尝试删除@EnableScan
注解,看看是否能够正常工作。在大多数情况下,不建议在生产环境中使用@EnableScan
,因为它会扫描整个表,性能会受到影响。public interface MusicRepository extends CrudRepository<Music, MusicId> { }
完成以上步骤后,尝试重新构建和运行你的应用程序,看看问题是否得到解决。
英文:
I am learning DynamoDb, so was trying to do a basic project using Spring Boot and DynamoDB. I checked these link to run this application successfully, but got failed
- https://stackoverflow.com/a/57386532/2952011
- http://johnhunsley.blogspot.com/2016/11/spring-data-jpa-with-hash-range-key.html
- https://medium.com/@leohoc/dynamodb-and-spring-data-a81c546a1305
For db setup, I used docker. Here is my compose file:
version: '3.7'
services:
localstack:
container_name: localstack
image: localstack/localstack:latest
environment:
- DEBUG=1
- USE_SSL=0
- AWS_CBOR_DISABLE=1
- DOCKER_HOST=unix:///var/run/docker.sock
- HOSTNAME=localstack
- SERVICES=dynamodb
- AWS_DEFAULT_REGION=us-east-1
ports:
- '4566-4583:4566-4583'
volumes:
- ${TEMPDIR:-/tmp/localstack}:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
- ./script/init-dynamodb.sh:/docker-entrypoint-initaws.d/init-dynamodb.sh
The script to create tables is here:
#!/bin/bash
# -- > Create DynamoDb Table
echo Creating DynamoDb \'ItemInfo\' table ...
echo $(awslocal dynamodb create-table --cli-input-json '{
"TableName":"ItemInfo",
"KeySchema":
[
{"AttributeName":"id","KeyType":"HASH"}
],
"AttributeDefinitions":
[
{"AttributeName":"id","AttributeType":"S"}
],
"BillingMode":"PAY_PER_REQUEST"
}'
)
echo Creating DynamoDb \'Music\' table ...
echo $(awslocal dynamodb create-table --cli-input-json '{
"TableName":"Music",
"KeySchema":
[
{"AttributeName":"Artist","KeyType":"HASH"},
{"AttributeName":"SongTitle","KeyType":"RANGE"}
],
"AttributeDefinitions":
[
{"AttributeName":"Artist","AttributeType":"S"},
{"AttributeName":"SongTitle","AttributeType":"S"}
],
"ProvisionedThroughput":{
"WriteCapacityUnits": 5,
"ReadCapacityUnits": 5
},
"TableClass": "STANDARD"
}'
)
# --> List DynamoDb Tables
echo Listing tables ...
echo $(awslocal dynamodb list-tables)
So after running:
sudo docker compose up -d
when I execute this:
aws --endpoint-url=http://localhost:4566 --region=us-east-1 dynamodb describe-table --table-name Music
I am getting this:
{
"Table": {
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"TableName": "Music",
"KeySchema": [
{
"AttributeName": "Artist",
"KeyType": "HASH"
},
{
"AttributeName": "SongTitle",
"KeyType": "RANGE"
}
],
"TableStatus": "ACTIVE",
"CreationDateTime": "2023-03-07T14:17:46.287000+06:00",
"ProvisionedThroughput": {
"LastIncreaseDateTime": "1970-01-01T06:00:00+06:00",
"LastDecreaseDateTime": "1970-01-01T06:00:00+06:00",
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"TableSizeBytes": 0,
"ItemCount": 0,
"TableArn": "arn:aws:dynamodb:us-east-1:000000000000:table/Music",
"TableId": "bcce1ab3-8f0c-4b8f-9d55-6c69ec1ef2ad",
"Replicas": [],
"TableClassSummary": {
"TableClass": "STANDARD"
}
}
}
So I believe table creation is okay. Now I am showing the (DynamoDB Table) Music class:
@DynamoDBTable(tableName = "Music")
public class Music implements Serializable {
@Id
private MusicId musicId;
public Music() {}
public Music(MusicId musicId) {
this.musicId = musicId;
}
public MusicId getMusicId() {
return musicId;
}
public void setMusicId(MusicId musicId) {
this.musicId = musicId;
}
@DynamoDBHashKey(attributeName = "Artist")
public String getArtist() {
return musicId != null ? musicId.getArtist() : null;
}
public void setArtist(String artist) {
if (musicId == null)
musicId = new MusicId();
musicId.setArtist(artist);
}
@DynamoDBRangeKey(attributeName = "SongTitle")
public String getSongTitle() {
return musicId != null ? musicId.getSongTitle() : null;
}
public void setSongTitle(String songTitle) {
if (musicId == null)
musicId = new MusicId();
musicId.setSongTitle(songTitle);
}
}
Here is MusicId (DynamoDB Document) class:
@DynamoDBDocument
public class MusicId implements Serializable {
private static final long serialVersionUID = 100L;
public MusicId() {
}
public MusicId(String artist, String songTitle) {
this.artist = artist;
this.songTitle = songTitle;
}
private String artist;
private String songTitle;
@DynamoDBHashKey(attributeName = "Artist")
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
@DynamoDBRangeKey(attributeName = "SongTitle")
public String getSongTitle() {
return songTitle;
}
public void setSongTitle(String songTitle) {
this.songTitle = songTitle;
}
}
Here is MusicRepository:
@EnableScan
public interface MusicRepository extends CrudRepository<Music, MusicId> {
}
Here is DynamoDbServiceImpl which implements DynamoDbService:
@Service
public class DynamoDbServiceImpl implements DynamoDbService {
private final ItemInfoRepository itemInfoRepository;
private final MusicRepository musicRepository;
@Autowired
public DynamoDbServiceImpl(ItemInfoRepository itemInfoRepository, MusicRepository musicRepository) {
this.itemInfoRepository = itemInfoRepository;
this.musicRepository = musicRepository;
}
@Override
public void saveItem(ItemInfoDto dto) {
ItemInfo itemInfo = new ItemInfo();
itemInfo.setItemName(dto.getItemName());
itemInfo.setItemUrl(dto.getItemUrl());
itemInfoRepository.save(itemInfo);
}
@Override
public void saveMusic(MusicDto dto) {
Music music = new Music();
music.setArtist(dto.getArtist());
musicRepository.save(music);
}
}
And here is the AwsDynamoDbConfig to configure:
@Getter
@Setter
@Configuration
@EnableDynamoDBRepositories(basePackages = "com.mukit09.dynamodblearning.repository")
public class AwsDynamoDbConfig {
@Value("${config.aws.region}")
private String region;
@Value("${config.aws.dynamodb.url}")
private String dynamoDbEndpointUrl;
@Value("${config.aws.dynamodb.access-key}")
private String accessKey;
@Value("${config.aws.dynamodb.secret-key}")
private String secretKey;
@Bean(name = "amazonDynamoDB")
public AmazonDynamoDB amazonDynamoDB() {
return AmazonDynamoDBClientBuilder.standard()
.withCredentials(getCredentialsProvider())
.withEndpointConfiguration(getEndpointConfiguration(dynamoDbEndpointUrl))
.build();
}
private EndpointConfiguration getEndpointConfiguration(String url) {
return new EndpointConfiguration(url, region);
}
private AWSStaticCredentialsProvider getCredentialsProvider() {
return new AWSStaticCredentialsProvider(getBasicAWSCredentials());
}
private BasicAWSCredentials getBasicAWSCredentials() {
return new BasicAWSCredentials(accessKey, secretKey);
}
}
These are the contents from application.properties:
#dynamoDB
config.aws.region=us-east-1
config.aws.dynamodb.url=http://127.0.0.1:4566
config.aws.dynamodb.access-key=localstack
config.aws.dynamodb.secret-key=localstack
#log
logging.file.name=debug.log
logging.level.root= debug
This is my gradle file (build.gradle):
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.9'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
group = 'com.mukit09'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.github.derjust:spring-data-dynamodb:5.1.0'
implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.12.420'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}
When I try to run this application, it is failed keeping this log:
2023-03-07 17:32:17.375 ERROR 68881 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dynamoDbController' defined in file [/home/mukit09/code/java/dynamodb-learning/build/classes/java/main/com/mukit09/dynamodblearning/controller/DynamoDbController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dynamoDbServiceImpl' defined in file [/home/mukit09/code/java/dynamodb-learning/build/classes/java/main/com/mukit09/dynamodblearning/service/impl/DynamoDbServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'musicRepository' defined in com.mukit09.dynamodblearning.repository.MusicRepository defined in @EnableDynamoDBRepositories declared on AwsDynamoDbConfig: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/core/support/ReflectionEntityInformation
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.9.jar:2.7.9]
at com.mukit09.dynamodblearning.DynamodbLearningApplication.main(DynamodbLearningApplication.java:10) ~[main/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dynamoDbServiceImpl' defined in file [/home/mukit09/code/java/dynamodb-learning/build/classes/java/main/com/mukit09/dynamodblearning/service/impl/DynamoDbServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'musicRepository' defined in com.mukit09.dynamodblearning.repository.MusicRepository defined in @EnableDynamoDBRepositories declared on AwsDynamoDbConfig: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/core/support/ReflectionEntityInformation
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.25.jar:5.3.25]
... 19 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'musicRepository' defined in com.mukit09.dynamodblearning.repository.MusicRepository defined in @EnableDynamoDBRepositories declared on AwsDynamoDbConfig: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/core/support/ReflectionEntityInformation
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.25.jar:5.3.25]
... 33 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/core/support/ReflectionEntityInformation
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBEntityMetadataSupport.getEntityInformation(DynamoDBEntityMetadataSupport.java:125) ~[spring-data-dynamodb-5.1.0.jar:5.1.0]
at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getEntityInformation(DynamoDBRepositoryFactory.java:104) ~[spring-data-dynamodb-5.1.0.jar:5.1.0]
at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getDynamoDBRepository(DynamoDBRepositoryFactory.java:128) ~[spring-data-dynamodb-5.1.0.jar:5.1.0]
at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getTargetRepository(DynamoDBRepositoryFactory.java:150) ~[spring-data-dynamodb-5.1.0.jar:5.1.0]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:325) ~[spring-data-commons-2.7.8.jar:2.7.8]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323) ~[spring-data-commons-2.7.8.jar:2.7.8]
at org.springframework.data.util.Lazy.getNullable(Lazy.java:231) ~[spring-data-commons-2.7.8.jar:2.7.8]
at org.springframework.data.util.Lazy.get(Lazy.java:115) ~[spring-data-commons-2.7.8.jar:2.7.8]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:329) ~[spring-data-commons-2.7.8.jar:2.7.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.25.jar:5.3.25]
... 44 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.core.support.ReflectionEntityInformation
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
... 64 common frames omitted
Process finished with exit code 1
As a learner of this stack, definitely I did some mistake. Would you please help me please to find the error I made please?
答案1
得分: 1
这是一个已知问题,你可以在这里和这里找到相关信息,因为Spring版本大于2.2的情况下不受支持。
有一个分支可能可以解决这个问题,但我没有进行测试:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论