仔细分析后:
原来是在测试时,没有导入redis.properties文件,value把 r e d i s . m a x I d l e 解 析 为 字 符 串 , 所 以 会 报 : F o r i n p u t s t r i n g : " {redis.maxIdle}解析为字符串,所以会报: For input string: " redis.maxIdle解析为字符串,所以会报:Forinputstring:"{redis.maxIdle}"异常。实际在项目部署启动tomcat后就不会报这样的异常,因为不会获取不到配置文件。
更改方法:
在spring配置文件目录下apllicationContext-redis中添加
<context:property-placeholder location=“classpath*:properties/*.properties” />
作者:追梦的蚂蚁。
来源:CSDN
原文:https://blog.csdn.net/m0_37768843/article/details/82910093
版权声明:本文为博主原创文章,转载请附上博文链接!