关于java.lang.NumberFormatException: For input string:${redis.maxIdle}的报错

仔细分析后:

原来是在测试时,没有导入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}"异常。实际在项目部署启动tomcat后就不会报这样的异常,因为不会获取不到配置文件。

更改方法:

在spring配置文件目录下apllicationContext-redis中添加

<context:property-placeholder location=“classpath*:properties/*.properties” />

作者:追梦的蚂蚁。
来源:CSDN
原文:https://blog.csdn.net/m0_37768843/article/details/82910093
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/Java_Enthusiast/article/details/85047735