Invalid property 'nodeAddresses' of bean class [org.redisson.config.ClusterServersConfig]: Bean property 'nodeAddresses' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
时间: 2024-02-27 17:57:35 浏览: 33
这个错误提示是因为 Redisson 的 ClusterServersConfig 类中没有名为 `nodeAddresses` 的属性。在该类中,用于指定 Redis 节点地址的属性为 `addNodeAddress` 或 `setNodeAddresses`。
以下是使用 Redisson 配置 Cluster 模式的示例 XML 配置,其中使用了 `setNodeAddresses`:
```xml
<bean id="redisson" class="org.redisson.spring.starter.RedissonAutoConfiguration">
<property name="config">
<bean class="org.redisson.config.Config">
<property name="transportMode" value="NIO" />
<property name="threads" value="16" />
<property name="useLinuxNativeEpoll" value="true" />
<property name="clusterServersConfig">
<bean class="org.redisson.config.ClusterServersConfig">
<property name="nodeAddresses">
<set>
<value>redis://127.0.0.1:6379</value>
<value>redis://127.0.0.1:6380</value>
<value>redis://127.0.0.1:6381</value>
</set>
</property>
<property name="scanInterval" value="1000" />
</bean>
</property>
</bean>
</property>
</bean>
```
您可以将 `nodeAddresses` 改为 `setNodeAddresses`,然后重新运行您的应用程序即可。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)