Repository: ranger Updated Branches: refs/heads/master 5b0fbac88 -> e47181f40
RANGER-1802 Here is a error in getStatusResponse() when post data exception for AtlasClient class Signed-off-by: peng.jianhua <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/e47181f4 Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/e47181f4 Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/e47181f4 Branch: refs/heads/master Commit: e47181f40d98c73b9486616a4d506d82fe7326e7 Parents: 5b0fbac Author: peng.jianhua <[email protected]> Authored: Wed Sep 27 09:58:02 2017 +0800 Committer: peng.jianhua <[email protected]> Committed: Thu Sep 28 15:58:37 2017 +0800 ---------------------------------------------------------------------- .../org/apache/ranger/services/atlas/client/AtlasClient.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/e47181f4/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/client/AtlasClient.java ---------------------------------------------------------------------- diff --git a/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/client/AtlasClient.java b/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/client/AtlasClient.java index c10da79..857df87 100644 --- a/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/client/AtlasClient.java +++ b/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/client/AtlasClient.java @@ -53,6 +53,7 @@ public class AtlasClient extends BaseClient { private static final Logger LOG = Logger.getLogger(AtlasClient.class); private static final String EXPECTED_MIME_TYPE = "application/json"; + private static final String WEB_RESOURCE_CONTENT_TYPE = "application/x-www-form-urlencoded"; private static final String ATLAS_STATUS_API_ENDPOINT = "/j_spring_security_check"; /*** TYPE **/ private static final String ATLAS_LIST_TYPE_API_ENDPOINT = "/api/atlas/types/"; @@ -191,11 +192,11 @@ public class AtlasClient extends BaseClient { } formData.add("j_password", decryptedPwd); try { - statusResponse = webResource.type("application/x-www-form-urlencoded").post(ClientResponse.class, + statusResponse = webResource.type(WEB_RESOURCE_CONTENT_TYPE).post(ClientResponse.class, formData); } catch (Exception e) { - String msgDesc = "Unable to get a valid statusResponse for " + "expected mime type : [" - + EXPECTED_MIME_TYPE + "] URL : " + statusUrl + " - got null response."; + String msgDesc = "Unable to get a valid statusResponse for expected mime type : [" + + WEB_RESOURCE_CONTENT_TYPE + "] URL : " + statusUrl + " - got null response."; LOG.error(msgDesc); } if (LOG.isDebugEnabled()) {
