Running following code on tomcat throws null pointer exception. Running same code in java main method runs fine.
RestClient rc = new RestClient(clientID, clientSecret, serverURL);
System.out.println("server-> " + rc.server);
try {
rc.authorize(username, extension, password);
GetVersionsResponse result = rc.restapi().list();
System.out.println("Result " + result.uri);
rc.revoke();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (RestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
java.lang.NullPointerException
at com.ringcentral.RestClient.requestRaw(RestClient.java:257)
at com.ringcentral.RestClient.request(RestClient.java:320)
at com.ringcentral.RestClient.request(RestClient.java:251)
at com.ringcentral.RestClient.post(RestClient.java:146)
at com.ringcentral.paths.restapi.oauth.token.Index.post(Index.kt:18)
at com.ringcentral.RestClient.authorize(RestClient.java:113)