package com.aa.myMemcache;import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;import com.danga.MemCached.MemCachedClient;
import com.danga.MemCached.SockIOPool;@SuppressWarnings("serial")
public class MemcacheTest implements Serializable { private static MemCachedClient mcc = new MemCachedClient(); static {
String[] servers = { "192.168.20.167:11211" };
Integer[] weight = { 3 };
SockIOPool pool = SockIOPool.getInstance();
pool.setServers(servers);
pool.setWeights(weight);
pool.setFailover(true);
pool.setInitConn(5);
pool.setMaintSleep(250);
pool.setMinConn(5);
pool.initialize(); } protected static MemcacheTest instance = new MemcacheTest(); public static MemcacheTest Instance() {
return instance;
} public Object getstring(String key) {
return mcc.get(key);
} public static void main(String[] args) {
MemcacheTest cache = MemcacheTest.Instance();
try { JSONArray jsonArray=new JSONArray();
jsonArray.put("json");
jsonArray.put("at");
mcc.add("ff",jsonArray);     
        System.out.println(mcc.keyExists("ff"));
} catch (Exception e) {

e.printStackTrace();
}
}}
程序运行之后显示false,没有存到memcached里面啊!我存了其他的据类型不管是基本的还是自己定义的对象都可以放到memcached里面。但是为什么json就不能放到里面啊?如果有高手知道,请教了!谢谢