我正忙于关注 Heroku 的 Java 的 Memcached 教程:https ://devcenter.heroku.com/articles/memcache#using-spymemcached-with-spring
我已经通过自制软件安装了 Memcached,启动并运行,添加了 Spymemcached 依赖项并将 XML 配置添加到我的应用程序上下文中。
问题是我对 MEMCACHE_USERNAME 和 MEMCACHE_PASSWORD 环境变量需要什么一无所知,因为当我的应用程序上下文在本地启动时出现以下身份验证失败:
2013-04-21 18:22:52.108 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-04-21 18:22:52.127 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@228ef305
2013-04-21 18:22:52.283 WARN net.spy.memcached.auth.AuthThread: Authentication failed to localhost/127.0.0.1:11211
2013-04-21 18:22:52.398 WARN net.spy.memcached.auth.AuthThread: Authentication failed to localhost/127.0.0.1:11211
2013-04-21 18:22:52.520 WARN net.spy.memcached.auth.AuthThread: Authentication failed to localhost/127.0.0.1:11211 ...
提供用户名和密码的配置:
<bean id="plainCallbackHandler" class="net.spy.memcached.auth.PlainCallbackHandler">
<constructor-arg index="0" value="${MEMCACHE_USERNAME}"/>
<constructor-arg index="1" value="${MEMCACHE_PASSWORD}"/>
</bean>
我一定遗漏了一些相当明显的东西......任何指针?