Defined in Applicationcontext-redis.xml
<bean id= "Jedisclientpool" class= "Cn.e3mall.common.jedis.JedisClientPool" >
<property name= "Jedispool" ref= "Jedispool" ></property>
</bean>
<bean id= "Jedispool" class= "Redis.clients.jedis.JedisPool" >
<constructor-arg name= "host" value= "192.168.25.128"/>
<constructor-arg name= "Port" value= "6379"/>
</bean>
As a result, a run-time error occurred:
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' jedisclientpool ' defined in Class path resource [Spring/applicationcontext-redis.xml]: Error setting property values; Nested exception is Org.springframework.beans.NotWritablePropertyException:Invalid property ' Jedispool ' of Bean class [ Cn.e3mall.common.jedis.JedisClientPool]: Bean property ' Jedispool ' was not writable or had an invalid setter method. Does the parameter type of the setter match the return type of the getter?
......
......
......
caused By:org.springframework.beans.NotWritablePropertyException:Invalid property ' Jedispool ' of Bean class [ Cn.e3mall.common.jedis.JedisClientPool]: Bean property ' Jedispool ' was not writable or had an invalid setter method. Does the parameter type of the setter match the return type of the getter?
.......
.......
Where the "Bean property ' Esyerdao ' was not writable or had an invalid setter method" was a critical error
Originally, the Set and get methods need to be defined in Jedisclientpool.
public void Setjedispool (Jedispool jedispool) {
This.jedispool = Jedispool;
}
Public Jedispool Getjedispool () {
return jedispool;
}
Supplementary, case is strictly differentiated, <property name= "Jedispool" ref= "Jedispool"/> and <property name= "Jedispool" ref= "Jedispool"/ > is not the same, for Name= "Jedispool", define set and get methods in Jedisclientpool with lowercase setjedispool and getjedispool:
public void Setjedispool (Jedispool jedispool) {
This.jedispool = Jedispool;
}
Public Jedispool Getjedispool () {
return jedispool;
}
Reference Address: http://deswork.blog.163.com/blog/static/1638466472010910103523736/
When using spring injection, the presence of XXX is not writable or have an invalid setter method