开发者社区> 问答> 正文

memcached连接问题java.net.ConnectException: ?报错

这个是我运行showcase的时候遇到的,根据文档eclipse导入了showcase,修改数据库连接信息后,运行项目,能运行,但是出现下面这个错误,对于这个memcached还不是很熟悉,请问怎么修改配置才能消除这个错误?

mecached配置:memcached.url=localhost:11211

<bean id="spyMemcachedClient" class="org.springside.modules.cache.memcached.SpyMemcachedClient">
<property name="memcachedClient">
<bean class="net.spy.memcached.spring.MemcachedClientFactoryBean">
<property name="servers" value="${memcached.url}" />
<!-- 默认是TEXT -->
<property name="protocol" value="TEXT" />
<!-- 默认是ARRAY_MOD -->
<property name="locatorType" value="CONSISTENT" />
<!-- 默认是2500毫秒 -->
<property name="opTimeout" value="1000" />
</bean>
</property>
<property name="updateTimeout" value="1000"/>
<property name="shutdownTimeout" value="1000"/>
</bean>


<beans profile="development,functional,test">
<!-- 演示用的JMemcached, 模拟Memcached服务器 -->
<bean id="memcachedSimulator" class="org.springside.modules.test.cache.memcached.MemcachedSimulator" lazy-init="false">
<property name="serverUrl" value="${memcached.url}" />
</bean>
</beans>

报错信息如下:

2013-12-12 11:25:51.973 WARN net.spy.memcached.MemcachedConnection:  Closing, and reopening {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}, attempt 3.

2013-12-12 11:26:07.974 INFO net.spy.memcached.MemcachedConnection:  Reconnecting {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2013-12-12 11:26:08.981 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@17a53be
2013-12-12 11:26:08.982 INFO net.spy.memcached.MemcachedConnection:  Reconnecting due to failure to connect to {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:485)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:322)
at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:1047)

展开
收起
爱吃鱼的程序员 2020-06-22 13:55:42 890 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    看下telnet127.0.0.1 <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">11211能否上去造成问题的原因可能也有很多种,看具体环境<divclass="ref">

    引用来自“quyf”的答案

    <divclass=ref_body>造成问题的原因可能也有很多种,看具体环境

    2020-06-22 13:55:59
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载