firemail
标题:
spring中从缓存中取出的同一类型转换不成功
[打印本页]
作者:
java
时间:
2017-11-1 16:22
标题:
spring中从缓存中取出的同一类型转换不成功
本帖最后由 java 于 2017-11-1 16:23 编辑
Object cacheData = cacheService.get(cacheKey);
if (Optional.ofNullable(cacheData).isPresent() && cacheData instanceof FaqKnowledgeResult) { //cacheData instanceof FaqKnowledgeResult 始终为false
faqKnowledgeCacheResult = (FaqKnowledgeResult) cacheData;
}
public static void main(String[] args) {
System.setProperty("spring.devtools.restart.enabled", "false"); //增加这一行
SpringApplication.run(Application.class, args);
}
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3