I have this very simple example that serializes and deserializes the first Account found:
System.debug( (Account)JSON.deserialize( JSON.serialize([SELECT Id, Name FROM Account LIMIT 1]), Account.class));
It fails with an error:
System.JSONException: Json Deserialization failed on token 'null' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row
With no own code whatsoever - why does this fail? And what can I do to get it running?