Share all details related to your problem, including any error messages you may have received.
I am working on a Web service integration that needs the customization rule to show in the UI when an account is disabled or enabled. I have the below code, however I’m running into a Null Pointer error. The thing is, the past configuration used Employee ID as a schema attribute, but I want to now use AssociateId. I beleve this is why I am getting this error. Does anyone have any insight on this?
AssociateID appears to be coming back as null in your account response. This is truly where the error is coming from. Essentially, the error means it cannot process the account because it needs the Identity Attribute value that you told it to look for, and it cannot find it based on your current config.
Make sure you Account Aggregation response mapping is set up properly to pull in AssociateID from your HTTP response and that the schema attribute you map in the response mapping matches the actual schema attribute you define for AssociateID (case sensitive). And lastly make sure your schema Identity Attribute has that same correct reference so everything flows properly.
Error:
The application script threw an exception: java.lang.NullPointerException: Null Pointer in Method Invocation BSF info: User Status Check - BC at line: 0 column: columnNo
Identity attribute [AssociateID] was not found.: {associateID=null, Active=false, AuthorityProfile=null, FirstName=Default, UserRoles=, LastName=Owner, UserGroups=[Default Root Group]}
you see sailpoint is expecting attribute [AssociateID] while in resultset you have attribute associateID - As Patrick mentioned - you have to change the identity attribute in the schema to match what you get from the aggregation. Also [] brackets are not needed most probably.
Second issue is that even if you change the identity attribute name - it will still cause problems as you see associateID is null in your resultset so I would check if you have correct response mapping for this attribute in the operation definition.
Never call your logger log. There’s already a passed in logger called log. I call my custom Logger alog also define your Logger before your first use.
Second, use of alog.warn or alog.error for debugging is not good practice. Rather, either put the elements into your log4j2.properties file or do an alog.setLevel(Level.DEBUG) and then use alog.debug statements, that way when you go to production you can just comment out the setLevel line.
Third, your logger hierarchy is backwards. Go from most general to most specific, you are doing this backwards.
I also see inappropriate quote marks in the message, hopefully you are not copy pasting from a Word document, it converts everything to smart quotes and you want simple quotes. And what goes into the getStringAttribute call needs to be spelled and capitalized exactly as it’s found in the schema definition.
Finally, kudos for using Yodaspeak for your string compare but please don’t use Yodaspeak for your null check. Never do if (null == or if(null != always do it the other way around. I have seen NPEs for when people do this for null checks. It’s rare but I have seen it.
Your call is going to be object.getStringAttribute(“Active”) and that’s it. Not even sure how your call even passed the compiler it’s not an actual valid method argument.
@mercury@kjakubiak Thank you both for the feedback! I did some modifications based on the notes you provided.
I have verified that AssociateId is consistent within the schema and attributes. I also updated the loggers to follow best practices.
It still seems to be failing on the null pointer of “AssociateId is not found”, but the code it states, if not null =true, else= false.
Not sure what I am missing here.
Code:
Blockquote
Import
Error:
Exception during aggregation. Reason: java.lang.RuntimeException: sailpoint.connector.ConnectorException: The application script threw an exception: java.lang.NullPointerException: Null Pointer in Method Invocation BSF info: Sentry User Status Check - BC at line: 0 column: columnNo
2024-01-02 08:43:42 ERROR QuartzScheduler_Worker-3 sailpoint.connector.AbstractConnector:1194 - Identity attribute [AssociateId] was not found.
Logs:
2024-01-02 08:43:42 ERROR QuartzScheduler_Worker-3 sailpoint.connector.webservices.v2.WebServiceFacadeV2:2127 - Error while RO transformation - Identity attribute [AssociateId] was not found.: {Active=false, AuthorityProfile=null, FirstName=Default, UserRoles=, AssociateId=null, LastName=User, UserGroups=[Default]}
Would it be possible for you to add here the application XML? That would help us to troubleshoot. Also if you could add sample payload you are getting from the app that would be fantastic.
I looked at your error again. It appears that your decoding of the response does not include AssociateID OR that the record you are getting back from your REST call is not pulling in this value. Either way, because likely you have this as the identity attribute (native identity) the record can’t be aggregated. You need to pull this with Postman to verify the response, and then look at your response mapping to make sure it is interpreted properly.
I have done similar integration in the past and the body of the Account Aggregation endpoint did not have any body. I dont see the option in the UI to add a body.
That’s fine to not have body in get operation. My suspicion is that there’s either missmatch between the payload you are getting from the endpoint and your response mappings or the payload does not xontain all attributes you expect.
That’s why it would be great to see what you get from the endpoint directly.