我在服务器启动时收到此警告。
INFO 13868 --- s.DynamoDBRepositoryFactory : Spring Data Version: 2.3.7.RELEASE
INFO 13868 --- s.DynamoDBRepositoryFactory : AWS SDK Version: 1.11.64
INFO 13868 --- s.DynamoDBRepositoryFactory : Java Version: 11.0.7 - Java HotSpot(TM) 64-Bit Server VM 11.0.7+8-LTS
INFO 13868 --- s.DynamoDBRepositoryFactory : Platform Details: Windows 10 10.0
WARN 13868 --- s.DynamoDBRepositoryFactory : This Spring Data DynamoDB implementation might not be compatible with the available Spring Data classes on the classpath!
https://github.com/boostchicken/spring-data-dynamodb
这就是gradle依赖。
plugins {
id("org.springframework.boot") version "2.4.3"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("com.google.cloud.tools.jib") version "2.7.1"
id("com.github.jk1.dependency-license-report") version "1.16"
id("java")
}
java.sourceCompatibility = JavaVersion.VERSION_11
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.970'
//implementation 'com.github.derjust:spring-data-dynamodb:5.1.0'
implementation 'io.github.boostchicken:spring-data-dynamodb:5.2.5'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
当我在get方法上使用@dynamodbrangekey时,我得到的是classnotfoundexception。服务器未启动。如果我不使用@dynamodbrangekey,那么服务器的声明是正确的。但是我必须使用@dynamodbrangekey来指定范围键。
@DynamoDBTable(tableName = "partner_signup")
public class PartnerSignup {
@Id
//@DynamoDBIgnore
private ProductSignupId productSignupId;
private String partnerId;
private String partnerType;
//@DynamoDBAttribute(attributeName = "partner_type")
@DynamoDBRangeKey(attributeName = "partner_type")
public String getPartnerType() {
System.out.println(" partner_type " + productSignupId.getPartnerType());
return productSignupId != null ? productSignupId.getPartnerType() : null;
}
}
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]
需要在依赖项中添加或修改什么吗?什么是springdatadynamodb和springboot的兼容版本。
暂无答案!
目前还没有任何答案,快来回答吧!