今天测试memcache 连接时候出现的错误
SchoonerSockIOPool-attempting to get SockIO from uninitialized pool!
看错误原因应该是没初始化MemCachedClient 的连接池,但是连接池是初始化过的,
SockIOPool pool = SockIOPool.getInstance();
if(pool == null){
log.error("Failed to SockIOPool.getInstance");
}
pool.setServers(p.servers);
if (p.weights != null) pool.setWeights(p.weights);
if (p.initConn != null) pool.setInitConn(p.initConn);
if (p.minConn != null) pool.setMinConn(p.minConn);
if (p.maxConn != null) pool.setMaxConn(p.maxConn);
if (p.bufferSize != null) pool.setBufferSize(p.bufferSize);
if (p.maxIdle != null) pool.setMaxIdle(p.maxIdle);
//初始化并启动连接池
pool.initialize();
mccClient = new MemCachedClient(label);
断点到new MemCachedClient 时候发现连接池确实没刷新,最后发现了问题,SockIOPool.getInstance();也应该添加别名,
正确的是SockIOPool.getInstance(label);