¿Bitcoind devuelve "Respuesta JSON-RPC 2.0 no válida"?

Estoy empezando a usar una implementación básica de Bitcoin JSON RPC ( biblioteca dzhuvinov ) y obtengo un resultado extraño. Aquí está mi código:

public static void main(String[] args)
{
    URL serverURL = null;

    final String rpcuser ="user";
      final String rpcpassword ="pass";

      Authenticator.setDefault(new Authenticator() {
          protected PasswordAuthentication getPasswordAuthentication() {
              return new PasswordAuthentication (rpcuser, rpcpassword.toCharArray());
          }
      });
    try {
        serverURL = new URL("http://127.0.0.1:18332/");

    } catch (MalformedURLException e) {
        System.err.println(e.getMessage());
        return;
    }
     JSONRPC2Session mySession = new JSONRPC2Session(serverURL);
     String method = "getinfo";
     int requestID = 0;
     JSONRPC2Request request = new JSONRPC2Request(method, requestID);
     JSONRPC2Response response = null;
     try {
             response = mySession.send(request);

     } catch (JSONRPC2SessionException e) {
             System.err.println(e.getMessage());
             return;
     }
     if (response.indicatesSuccess())
        System.out.println(response.getResult());
    else
        System.out.println(response.getError().getMessage());
}

Y la respuesta que recibo es:

Invalid JSON-RPC 2.0 response

Solo para tener en cuenta: al ejecutar este script de Python:

access = jsonrpc.ServiceProxy("http://user:pass@127.0.0.1:18332/")
print access.getinfo()

Obtengo resultados adecuados.

¿Qué podría estar causando este problema y cómo debo solucionarlo?

¿Podrías adjuntar un rastreador de paquetes a ambos?
@NickODell Lo intentó, pero falló. Aunque descubrí cuál es el problema de otra manera.

Respuestas (1)

Resulta que a la biblioteca que estoy usando no le gustan las respuestas JSON que contienen tanto el campo "error" como la "respuesta", incluso si el campo "error" está establecido en nulo. Ya le he notificado al creador de la biblioteca que posiblemente solucione ese problema y también lo he reparado yo mismo:

En la private Map<String,Object> parseJSONObject(final String jsonString)función, uno necesita agregar esto al final:

    Map<String,Object> answer = (Map<String,Object>)json;

    if (answer.containsKey("error")){
        if (answer.get("error")==null){
            answer.remove("error");
        }
    }
    if (answer.containsKey("result")){
        if (answer.get("result")==null){
            answer.remove("result");
        }
    }

    return answer;