Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

REST connector ChangePassJSON: NullPointerException: Cannot invoke method size() on null object

FabianaS
New Contributor III
New Contributor III

Hello,

I'm working on a REST connector that should call a custom Web Service to first receive a bearer access token for connection, and then do another API call for the ChangePassJSON.

Connectivity is working fine and also a simple API "GET" call inside the testing block is working fine. 

Problem is with the API in the ChangePassJSON.

After changing password from the "Change account Password for self" in Saviynt, a task is created. When I run the job for provisioning, the job is successful but the task remains in Pending status.

Also, from Web Service logs, it seems that the server does not receive neither the call for requesting access token nor the call of the change password API.

API is working fine from Postman.

ChangePassJSON:

{

   "http":{

      "url":"http://aaa.aaa.aaa.aaa:9001/api/changepsw",

      "httpHeaders":{

         "Authorization":"${access_token}",

         "Content-Type":"application/json"

      },

      "httpContentType":"application/json",

      "httpMethod":"POST",

      "httpParams":{

         "username":"${username}",

         "newPassword":"${password}"

      }

   },

   "successResponse":[

     

   ],

   "successResponsePath":"",

   "errors":[

      "Couldn't authenticate you"

   ],

   "errorPath":"error"

}

 

I'm attaching the logs and it seems this is the main error: Error in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object

Thank you

15 REPLIES 15

stalluri
Valued Contributor II
Valued Contributor II

@FabianaS 
Can you try these and share the logs in text format.

${task.password}

${randompassword}
${account_password} 


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

FabianaS
New Contributor III
New Contributor III

with ${task.password}

2024-09-09T13:48:34.874+00:00ecm-workerservices.ArsTaskHelperServicequartzScheduler_Worker-8-9rp2vDEBUGValidating tasks for Securitysystem - WS_PSWSYNC
2024-09-09T13:48:34.874+00:00ecm-workerservices.ArsTaskHelperServicequartzScheduler_Worker-8-9rp2vDEBUGaccountName = f.sessa , taskType = 5 accountkey = 174402
2024-09-09T13:48:34.881+00:00ecm-workerpam.PamServicequartzScheduler_Worker-8-9rp2vDEBUGinside convertJsonStringToMap
2024-09-09T13:48:34.881+00:00ecm-workerpam.PamServicequartzScheduler_Worker-8-9rp2vDEBUGrotateKey - true 
2024-09-09T13:48:34.889+00:00ecm-workerpam.PamServicequartzScheduler_Worker-8-9rp2vDEBUGGranular Password Rotation is : 0
2024-09-09T13:48:34.898+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-8-9rp2vDEBUGCalling provisionAccountsAccess with Sec System - WS_PSWSYNC and tasklist - [f.sessa:[com.saviynt.ecm.task.ArsTasks : 1969]]
2024-09-09T13:48:34.898+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGProcessing Change Account Password Task for REST
2024-09-09T13:48:34.899+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGinitializing Provisioning connection
2024-09-09T13:48:34.902+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGTasks to work on = 1 
2024-09-09T13:48:34.902+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGaccounts accountID =f.sessa
2024-09-09T13:48:34.902+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGaccount: f.sessa 
2024-09-09T13:48:34.902+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGaccount?.systemid: 14
2024-09-09T13:48:34.928+00:00ecm-workerservices.SaviyntCommonUtilityServicequartzScheduler_Worker-8-9rp2vDEBUGEnter getStandardBindingVariable
2024-09-09T13:48:34.930+00:00ecm-workerservices.SaviyntCommonUtilityServicequartzScheduler_Worker-8-9rp2vDEBUGExit getStandardBindingVariable
2024-09-09T13:48:34.930+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vERRORError in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object
2024-09-09T13:48:34.930+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGTask Response: null 
2024-09-09T13:48:34.931+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-8-9rp2vDEBUGResult: false 
2024-09-09T13:48:34.933+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-8-9rp2vDEBUGchangePasswordAccountTarget - res - true
2024-09-09T13:48:34.934+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-8-9rp2vDEBUGInside updateProvisioningTries..
2024-09-09T13:48:34.948+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-8-9rp2vDEBUGEnter completePasswordTasks
2024-09-09T13:48:34.948+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-8-9rp2vDEBUGExit completePasswordTasks

 

${randompassword}

2024-09-09T13:56:11.268+00:00ecm-workerservices.ArsTaskHelperServicequartzScheduler_Worker-1-9rp2vDEBUGValidating tasks for Securitysystem - WS_PSWSYNC                
2024-09-09T13:56:11.269+00:00ecm-workerservices.ArsTaskHelperServicequartzScheduler_Worker-1-9rp2vDEBUGaccountName = f.sessa , taskType = 5 accountkey = 174402               
2024-09-09T13:56:11.276+00:00ecm-workerpam.PamServicequartzScheduler_Worker-1-9rp2vDEBUGinside convertJsonStringToMap                  
2024-09-09T13:56:11.276+00:00ecm-workerpam.PamServicequartzScheduler_Worker-1-9rp2vDEBUGrotateKey - true                   
2024-09-09T13:56:11.283+00:00ecm-workerpam.PamServicequartzScheduler_Worker-1-9rp2vDEBUGGranular Password Rotation is : 0                 
2024-09-09T13:56:11.293+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-1-9rp2vDEBUGCalling provisionAccountsAccess with Sec System - WS_PSWSYNC and tasklist - [f.sessa:[com.saviynt.ecm.task.ArsTasks : 1969]]         
2024-09-09T13:56:11.294+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGProcessing Change Account Password Task for REST                
2024-09-09T13:56:11.294+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGinitializing Provisioning connection                 
2024-09-09T13:56:11.297+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGTasks to work on = 1                   
2024-09-09T13:56:11.297+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGaccounts accountID =f.sessa                  
2024-09-09T13:56:11.297+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGaccount: f.sessa                   
2024-09-09T13:56:11.297+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGaccount?.systemid: 14                  
2024-09-09T13:56:11.322+00:00ecm-workerservices.SaviyntCommonUtilityServicequartzScheduler_Worker-1-9rp2vDEBUGEnter getStandardBindingVariable                 
2024-09-09T13:56:11.324+00:00ecm-workerservices.SaviyntCommonUtilityServicequartzScheduler_Worker-1-9rp2vDEBUGExit getStandardBindingVariable                 
2024-09-09T13:56:11.325+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vERRORError in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object           
2024-09-09T13:56:11.325+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGTask Response: null                   
2024-09-09T13:56:11.325+00:00ecm-workerrest.RestProvisioningServicequartzScheduler_Worker-1-9rp2vDEBUGResult: false                   
2024-09-09T13:56:11.328+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-1-9rp2vDEBUGchangePasswordAccountTarget - res - true                 
2024-09-09T13:56:11.329+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-1-9rp2vDEBUGInside updateProvisioningTries..                  
2024-09-09T13:56:11.347+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-1-9rp2vDEBUGEnter completePasswordTasks                  
2024-09-09T13:56:11.347+00:00ecm-workerservices.ArsTaskServicequartzScheduler_Worker-1-9rp2vDEBUGExit completePasswordTasks                  

Share in text file please


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

sure

"2024-09-09T13:55:39.818+00:00","ecm","rest.RestProvisioningService","http-nio-8080-exec-545-tzzxj","DEBUG","Got Webservice API Response: [headers:[WWW-Authenticate: Bearer error="invalid_token", error_description="An error occurred while attempting to decode the Jwt: Signed JWT rejected: Another algorithm expected, or no matching key(s) found", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1", X-Content-Type-Options: nosniff, X-XSS-Protection: 0, Cache-Control: no-cache, no-store, max-age=0, must-revalidate, Pragma: no-cache, Expires: 0, X-Frame-Options: DENY, Content-Length: 0, Date: Mon, 09 Sep 2024 13:55:39 GMT, Keep-Alive: timeout=60, Connection: keep-alive], responseText:, cookies:[], statusCode:401]"

 

Does other JSON's working ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

rushikeshvartak
All-Star
All-Star

Does it works from postman ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

yes

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]



⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

cURL:

curl --location 'http://aaa.aaa.aaa.aaa:9001/api/changepsw' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiIxMzg1OWY4Zi01MzY2LTRhNGUtYWYxYy0xOWUxMjI3NDk4MWIiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMTY0LjEyOS4yMjAuMTY1OjkwMDEiLCJzdWIiOiJXU1N5bmNocm9JRCIsImF1ZCI6IldTU3luY2hyb0lEIiwibmJmIjoxNzI1ODkwNDIxLCJleHAiOjE3MjU4OTIyMjEsImlhdCI6MTcyNTg5MDQyMX0.rGgZPRxrzAqwDL1TSgx3fKM8koO89FTERikYEIy5JIfyEW_hn99604rvT4rpiwmFAueK1abJ80Un2gWdIoZxXHEDQxf5FfsSDK3ZpaTpseeaP97Z30imE1kJBsIFv49Cf_M0W6UeoIPHEtcja_hluNTL6_sXrbi0cGdxunSjPdOkcGUwjK6GO8JnlYdWQ8CZFJcwZBryTScnWWtyD6uJmdKGqowmXQ7t9pKeITK2kg-dk2q7gJv6BO6J8eH6syBbBJ1vteL8CvtZ6Px523RJCS9iT3Z7hck9O6WWstpkXzrxtmE6E7Yt6mehH50QQA41natr0ckuPrJIh0cLhI8q_g' \
--data '{
"username": "Test18",
"newPassword": "newPassword2!"
}'

FabianaS_2-1725890824339.pngFabianaS_3-1725890880435.pngFabianaS_4-1725890921973.png

 

stalluri
Valued Contributor II
Valued Contributor II

@FabianaS 


Change it to:

 "httpParams":"{}",
 "Properties":{
         "username":"${username}",
         "newPassword":"${password}"
}


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

FabianaS
New Contributor III
New Contributor III

i got same error from logs
Error in processWebservicejava.lang.NullPointerException: Cannot invoke method size() on null object

Can you share configs screenshot to validate its done in proper block


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Do you mean the connectionJSON?

{

   "authentications": {

       "acctAuth": {

           "authType": "oauth2",

           "url": "http://aaa.aaa.aaa.aaa:9001/oauth2/token",

           "httpMethod": "POST",

           "httpParams": {

"grant_type": "client_credentials"

},

           "httpHeaders": {

               "Content-Type": "application/x-www-form-urlencoded",

               "Authorization": "Basic xxxxxxxxxxxx"

           },

           "expiryError": "ExpiredAuthenticationToken",

           "authError": [

               "Unable to authenticate the client",

               "Invalid OAuth token Bearer"

           ],

           "retryFailureStatusCode": [

               401,

               403

           ],

"httpContentType": "application/x-www-form-urlencoded",

           "errorPath": "error.code",

           "maxRefreshTryCount": 5,

           "tokenResponsePath": "access_token",

           "tokenType": "Bearer",

"testConnectionParams": {

       "http": {

         "url": "http://aaa.aaa.aaa.aaa:9001/api/test",

         "httpHeaders": {

 "Content-Type": "application/x-www-form-urlencoded",

           "Authorization": "${access_token}"

         },

         "httpMethod": "GET"

       },

"httpParams":{},

       "successResponse": [],

       "successResponsePath": "",

       "errors": [

         "Couldn't authenticate you"

       ],

"httpContentType": "application/x-www-form-urlencoded",

       "errorPath": "error"

     }

       }

   }

}

 

Here is the config:

FabianaS_0-1725899459751.png

Unfortunately ChangePassJSON is the only JSON I'm developing on this REST connector. Connection and test is working, Im also able to see it from my server logs:

FabianaS_1-1725899729569.png

[This post has been edited by a Moderator to remove sensitive information.]

Share postman screenshot of authentication


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

stalluri
Valued Contributor II
Valued Contributor II

@FabianaS 

 

{
    "call": [
        {
            "name": "call1",
            "connection": "acctAuth",
            "url": "http://aaa.aaa.aaa.aaa:9001/api/changepsw",
            "httpMethod": "POST",
            "httpParams": "{\"username\": \"${user.username}\", \"newPassword\": \"${password}\"}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    201,
                    200,
                    204
                ]
            }
        }
    ]
}

 


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.