NullPointerException only after I have setServiceAccountUser() for GoogleCredential object (Grails/Java)
问题 I receive a NullPointerException with very little detail when I attempt to setServiceAccountUser(ACCOUNT_TO_IMPERSONATE) on my GoogleCredential , build a Google Tasks Service Object and subsequently try to send a request for a list of Tasks from ACCOUNT_TO_IMPERSONATE . def credential = new GoogleCredential.Builder() .setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(SERVICE_ACCOUNT_ID) .setServiceAccountPrivateKeyFromP12File(P12_FILE) .setServiceAccountScopes