Chris Lamprecht clamprecht at
Mon Oct 15 02:06:42 UTC 2007

I'm using the java client by Dustin Sallings, 2.0-pre4, and under a load of
about 20 requests per second, I'm getting this error every few minutes (and
it seems to kill the NIO thread, so I have to restart the program):

Exception in thread "Memcached IO over {MemcachedConnection to
localhost/}" java.lang.NullPointerException
        at net.spy.memcached.protocol.ProxyCallback.gotData(
        at net.spy.memcached.protocol.ascii.GetOperationImpl.handleRead(
        at net.spy.memcached.protocol.ascii.OperationImpl.readFromBuffer(
        at net.spy.memcached.MemcachedConnection.handleReads(
        at net.spy.memcached.MemcachedConnection.handleIO(
        at net.spy.memcached.MemcachedConnection.handleIO(

Here's the code where the NPE is happening (just after the assert

public void gotData(String key, int flags, byte[] data) {
    Collection<GetOperation.Callback> cbs=callbacks.get(key);
    assert cbs != null : "No callbacks for key " + key;
    for(GetOperation.Callback c : cbs) {          <---- NPE here
        c.gotData(key, flags, data);

Any ideas?  I haven't dug into the code yet to try and debug it.  Also
previously I tried the 1.4 client version and got an NPE in
OptimizeGet.javaor something like that.  Thanks

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list