修正后jar包在附件内
异常代码:
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'houseKeepingSleepTime' of bean class [org.logicalcobwebs.proxool.ProxoolDataSource]: Bean property 'houseKeepingSleepTime' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
译:在类org.logicalcobwebs.proxool.ProxoolDataSource],中houseKeepingSleepTime属性无效,houseKeepingSleepTime属性不可写或houseKeepingSleepTime有一个无效的settter方法,houseKeepingSleepTime的setter方法的参数类型匹配getter方法的返回值类型吗
官方源码:
- /**
- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime
- */
- public long getHouseKeepingSleepTime() {
- return houseKeepingSleepTime;
- }
- /**
- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime
- */
- public void setHouseKeepingSleepTime(int houseKeepingSleepTime) {
- this.houseKeepingSleepTime = houseKeepingSleepTime;
- }
修正代码:
- /**
- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime
- */
- public long getHouseKeepingSleepTime() {
- return houseKeepingSleepTime;
- }
- /**
- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime
- *此处将int类型改为long类型
- */
- public void setHouseKeepingSleepTime(long houseKeepingSleepTime) {
- this.houseKeepingSleepTime = houseKeepingSleepTime;
- }
修正后jar包在附件内
本文解决了一个关于Spring框架中ProxoolDataSource配置异常的问题,具体表现为'houseKeepingSleepTime'属性不可写或setter方法无效。通过调整setter方法的参数类型从int到long解决了该问题。

789

被折叠的 条评论
为什么被折叠?



