【发布时间】:2020-05-02 08:46:08
【问题描述】:
我正在使用 Spring Boot 2.17 和 java sdk 以及 dynamodb-enhanced '2.13.8'。
我正在与增强客户端调用这样的项目:
public Product readProductById(String id) {
Key key = Key.builder()
.partitionValue(id)
.build();
Product product = productTable.getItem(key);
return product;
}
调用此错误时会导致:
class de.xxx.productsapi.db.Product cannot be cast to class de.xxx.productsapi.db.Product (de.xxx.productsapi.db.Product is in unnamed module of loader 'app'; de.xxx.productsapi.db.Product is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @19e19c7e)
java.lang.ClassCastException: class de.xxx.productsapi.db.Product cannot be cast to class de.xxx.productsapi.db.Product (de.xxx.productsapi.db.Product is in unnamed module of loader 'app'; de.xxx.productsapi.db.Product is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @19e19c7e)
切换 livereload to enabled: false 并没有帮助,但完全删除了 devtools 工作。但这是一个不令人满意的解决方案,因为我想使用 devtools。
感谢您的帮助
【问题讨论】:
标签: java amazon-web-services spring-boot amazon-dynamodb