Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

REST ConnectionJSON - No signature of method: java.util.LinkedHashMap.contains()

mmomin-xalient
New Contributor III
New Contributor III

Hi,

I am getting following error when trying to configure below connectionJson. Based on the logs (See attached), it appears that it first calls, getUser endpoint, which returns 400 bad requests then it invokes getAccessToken2 endpoint which seems to be successful because the subsequent call to getUser is now returning 200 statusCode with proper response. However, the overall connection status is still in failed state and logs are showing following error. 

ERROR:
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6","","groovy.lang.MissingMethodException: No signature of method: java.util.LinkedHashMap.contains() is applicable for argument types: (null) values: [null]"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6","","Possible solutions: containsKey(java.lang.Object), containsKey(java.lang.Object), toString(), toString(), toString(), toString()"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.provisoning.rest.RestProvisioningService.validateTestConnectionResponse(RestProvisioningService.groovy:11179)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.provisoning.rest.RestProvisioningService.testConnectionRest(RestProvisioningService.groovy:11109)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.ecm.integration.ExternalConnectionCallService.testExternalConnection(ExternalConnectionCallService.groovy:1012)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.ecm.utility.domain.EcmConfigController$_closure21.doCall(EcmConfigController.groovy:772)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.webservice.SaviyntRestAuthenticationFilter.doFilter(SaviyntRestAuthenticationFilter.groovy:158)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.mrhaki.grails.plugin.xframeoptions.web.XFrameOptionsFilter.doFilterInternal(XFrameOptionsFilter.java:69)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at java.lang.Thread.run(Thread.java:750)"

ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json"
},
"url": "http://XXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"username\": \"DOMAIN\\\\Svc-SaviD-CRM\",\"password\": \"XXXXXXXXXXXXXXXXX\"}",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"SESSION_NOT_VALID",
"AuthenticationFailed",
"invalid_grant"
],
"errorPath": "error.code",
"maxRefreshTryCount": 1,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer ABCD",
"retryFailureStatusCode": [
400,
401
],
"testConnectionParams": {
"http": {
"url": "http://XXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetUser",
"httpMethod": "GETWITHBODY",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpParams": "{\"LoginName\": \"DOMAIN\\\\\\\\Svc-SaviD-CRM\"}"
},
"successResponse": {
"statusCode": [
200
]
}
}
}
}
}

15 REPLIES 15

rushikeshvartak
All-Star
All-Star
{
  "authentications": {
    "acctAuth": {
      "authType": "oauth2",
      "httpHeaders": {
        "Accept": "application/json"
      },
      "url": "http://XXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
      "httpMethod": "POST",
      "httpContentType": "application/json",
      "httpParams": "{\"username\": \"DOMAIN\\\\Svc-SaviD-CRM\",\"password\": \"XXXXXXXXXXXXXXXXX\"}",
      "expiryError": "ExpiredAuthenticationToken",
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed",
        "SESSION_NOT_VALID",
        "AuthenticationFailed",
        "invalid_grant"
      ],
      "errorPath": "error.code",
      "maxRefreshTryCount": 1,
      "tokenResponsePath": "access_token",
      "tokenType": "Bearer",
      "accessToken": "Bearer ABCD",
      "retryFailureStatusCode": [
        400,
        401
      ]
    }
  }
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

This gives me success, but it doesn't test the connection. 

That is expected behavior for REST connector.
Save & Test Connection button on the connection will not actually test the connection it just validates the JSON's in the connection.

Regards,
Krishna Gupta
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

I understand what @rushikeshvartak shared output I am getting is expected behavior. But when I pass testConnectionParams to my connection string, even though Test Connection is returning 200 in the log, the connection status is showing failed, and I am getting groovy error which is shared on the main issue description. 

Using above connectionJSON, it is saving it fine in the connector without any errors but when I run the import job it is throwing following error. Not sure what is wrong with the JSON. it is same as you have it. 

"2024-05-23T15:55:43.715+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-1-m8dk2","DEBUG","Error parsing ConnectionJSON. Please verify if it is valid"
"2024-05-23T15:55:43.715+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-1-m8dk2","DEBUG","Exception in RestProvisioiningService.doImport :"
"2024-05-23T15:55:44.541+00:00","ecm-worker","","null-m8dk2","","java.lang.Exception: Error parsing ConnectionJSON. Please verify if it is valid at com.saviynt.provisoning.rest.RestProvisioningService.initializeConnectionForImport(RestProvisioningService.groovy:1902) at com.saviynt.provisoning.rest.RestProvisioningService.doImport(RestProvisioningService.groovy:122) at com.saviynt.ecm.integration.ExternalConnectionCallService.invokeExternalMethod(ExternalConnectionCallService.groovy:232) at SapImportJob.execute(SapImportJob.groovy:109) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)"
"2024-05-23T15:55:43.728+00:00","ecm-worker","rest.RestUtilService","quartzScheduler_Worker-1-m8dk2","DEBUG","Writing job history to import logs."

Username must be causing issue and in test connection param only GET call is supported 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

When i pass following ConnectionJSON, it is saving this and throwing successfull message but when I run the import Account Job, it gives an error saying ConnectionJSON parsing error. See my reply from above. 

{
  "authentications": {
    "acctAuth": {
      "authType": "oauth2",
      "httpHeaders": {
        "Accept": "application/json"
      },
      "url": "http://XXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
      "httpMethod": "POST",
      "httpContentType": "application/json",
      "httpParams": "{\"username\": \"DOMAIN\\\\Svc-SaviD-CRM\",\"password\": \"XXXXXXXXXXXXXXXXX\"}",
      "expiryError": "ExpiredAuthenticationToken",
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed",
        "SESSION_NOT_VALID",
        "AuthenticationFailed",
        "invalid_grant"
      ],
      "errorPath": "error.code",
      "maxRefreshTryCount": 1,
      "tokenResponsePath": "access_token",
      "tokenType": "Bearer",
      "accessToken": "Bearer ABCD",
      "retryFailureStatusCode": [
        400,
        401
      ]
    }
  }
}

 

 

{
  "authentications": {
    "acctAuth": {
      "authType": "oauth2",
      "httpHeaders": {
        "Accept": "application/json"
      },
      "url": "http://XXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
      "httpMethod": "POST",
      "httpContentType": "application/json",
      "httpParams": "{\"username\": \"DOMAIN\\Svc-SaviD-CRM\",\"password\": \"XXXXXXXXXXXXXXXXX\"}",
      "expiryError": "ExpiredAuthenticationToken",
      "authError": [
        "InvalidAuthenticationToken",
        "AuthenticationFailed",
        "SESSION_NOT_VALID",
        "AuthenticationFailed",
        "invalid_grant"
      ],
      "errorPath": "error.code",
      "maxRefreshTryCount": 1,
      "tokenResponsePath": "access_token",
      "tokenType": "Bearer",
      "accessToken": "Bearer ABCD",
      "retryFailureStatusCode": [
        400,
        401
      ]
    }
  }
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

When i pass it with two \\ between the domain and the account name, it fails with an error Target Error message is null. Only when I pass 4 slash it works. 

When I update the httpParams as an array then it takes 2 and not 4 slash 

"httpParams": {"username": "DOMAIN\\Svc-SaviD-CRM","password": "XXXXXXXXXXXXXXXXX"}

I may have to raise a ticket with Saviynt because it seems when I update the connectionJSON without the testConnectionParams it saves it successfully, but Job import fails with Parsing error. When I pass it with testConnectionParams it saves it with an error saying test connection failed but Job Import is able to fetch the accounts. 

Without testConnectionParams:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json",
"Content-Type": "application/json"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"SESSION_NOT_VALID",
"AuthenticationFailed",
"invalid_grant"
],
"url": "http://xxxxxxxxxxxxxxxx:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": {
"username": "DOMAIN\\Svc-SaviD-CRM",
"password": "XXXXXXXXXXX"
},
"retryFailureStatusCode": [
400,
401
]
}
}
}

With testConnectionParams:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json",
"Content-Type": "application/json"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"SESSION_NOT_VALID",
"AuthenticationFailed",
"invalid_grant"
],
"url": "http://xxxxxxxxxxxxxxxx:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": {
"username": "DOMAIN\\Svc-SaviD-CRM",
"password": "XXXXXXXXXXX"
},
"retryFailureStatusCode": [
400,
401
],
"testConnectionParams": {
"http": {
"url": "http://xxxxxxxxxxxxxxxx:8080/saviynt-dev/api/UserManagement/GetUser",
"httpMethod": "GETWITHBODY",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpParams": "{\"LoginName\": \"DOMAIN\\\\\\\\Svc-SaviD-CRM\"}"
},
"successResponse": {
"statusCode": [
200
]
}
}
}
}
}

 

 

"2024-05-22T12:46:05.902+00:00","ecm","services.HttpClientUtilityService","http-nio-8080-exec-28-9brx6","DEBUG","got response for api..."
"2024-05-22T12:46:05.902+00:00","ecm","rest.RestUtilService","http-nio-8080-exec-28-9brx6","DEBUG","Got showLogs = true"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","Got Webservice API Response: [headers:[Cache-Control: no-cache, Pragma: no-cache, Content-Type: application/json; charset=utf-8, Expires: -1, Vary: Accept-Encoding, Server: Microsoft-IIS/10.0, X-AspNet-Version: 4.0.30319, X-Powered-By: ASP.NET, Date: Wed, 22 May 2024 12:46:04 GMT], responseText:{"firstname":"Svc-SaviD-CRM","lastname":"crm","fullname":"Svc-SaviD-CRM crm","systemuserid":"ef5e8b6d-f211-ef11-a88f-00505684cdbc","domainname":"DOMAIN\\Svc-SaviD-CRM","internalemailaddress":null,"systemuserroles_association":[{"roleid":"35cb2a0a-210c-ef11-a897-eef67cb2f7cf","name":"Saviynt"}],"teammembership_association":[{"teamid":"8e534317-36e3-e111-8aef-0050568b60d0","name":"BHCRMPROD"}]}, cookies:[], statusCode:200]"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestUtilService","http-nio-8080-exec-28-9brx6","DEBUG","pullObjectsByRest - responseStatusCode ::200"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","Entered getResponseHeaders method"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","responseError : null"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","isAuthError: false"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","pullObjectsByRest - responseMap.size : 8"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","pullObjectsByRest - objectList.size : 1"
"2024-05-22T12:46:05.903+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-28-9brx6","DEBUG","Decrementing connectionParamMap.refreshTryCount : 0"

This is a snippet from the logs you had attached initially, you are getting a valid response for the getuser endpoint. The issue seems to be that Saviynt is not able to read the 200 statuscode and the response mapping where you are getting the error. Can you try with some other get call in the testconnectionparams?

For the import job issue, can you share your import json and the complete logs as well?


Regards,
Krishna Gupta
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Yeah, I thought so too but it does read the status code properly when I pass a valid accesstoken in "accessToken" parameter. Initially, my connection was successfully but I wanted to try to see if the access token is invalid does it try to generate a token and it tries and seems it succeeds too since the subsequent GetUser call is successful, but it errors out with some groovy error. 

Even with this groovy error, I am able to run Account Import JOB and get the data successfully, but it just fails with an error every time I am saving something in connector. 

ERROR:
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6","","groovy.lang.MissingMethodException: No signature of method: java.util.LinkedHashMap.contains() is applicable for argument types: (null) values: [null]"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6","","Possible solutions: containsKey(java.lang.Object), containsKey(java.lang.Object), toString(), toString(), toString(), toString()"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.provisoning.rest.RestProvisioningService.validateTestConnectionResponse(RestProvisioningService.groovy:11179)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.provisoning.rest.RestProvisioningService.testConnectionRest(RestProvisioningService.groovy:11109)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.ecm.integration.ExternalConnectionCallService.testExternalConnection(ExternalConnectionCallService.groovy:1012)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.ecm.utility.domain.EcmConfigController$_closure21.doCall(EcmConfigController.groovy:772)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.saviynt.webservice.SaviyntRestAuthenticationFilter.doFilter(SaviyntRestAuthenticationFilter.groovy:158)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.mrhaki.grails.plugin.xframeoptions.web.XFrameOptionsFilter.doFilterInternal(XFrameOptionsFilter.java:69)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)"
"2024-05-22T12:46:06.771+00:00","ecm","","null-9brx6",""," at java.lang.Thread.run(Thread.java:750)"

Here is the log file you. It is not very helpful

Share logs in both case with and without test conn params


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

I was able to get import account Job to work with passing 4 slashes in the httpParams array without testConnectionParams in connectionJSON string. This solved the parsing error and was able to successfully run the full import. It still fails when i pass the testConnectionParams but I guess I am not gonna stress about it.

Worked with following ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json",
"Content-Type": "application/json"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"SESSION_NOT_VALID",
"AuthenticationFailed",
"invalid_grant"
],
"url": "http://XXXXXXXXXXXXXXXXXXX:8080/saviynt-dev/api/UserManagement/GetAccessToken2",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": {
"username": "DOMAIN\\\\Svc-SaviD-CRM",
"password": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"retryFailureStatusCode": [
400,
401
]
}
}
}

testConnectionParams is not mandatory hence you can ignore.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.