How to fix a "com.glide.ui.ServletErrorListener: java.lang.NullPointerException" Error?

hamidouche
Kilo Expert

Hi All,

I have the following error (the stack trace excerpt below: emphasis mine ) when trying to insert data into a form:

java.lang.NullPointerException: java.lang.NullPointerException: com.glide.encryption.PlatformEncrypterDecrypter.encrypt(PlatformEncrypterDecrypter.java:63)
com.glide.encryption.PlatformEncrypterDecrypter.getEncryptedValue(PlatformEncrypterDecrypter.java:39)
com.glide.element.decorator.GEPlatformEncryptedValueDecorator.decorateSetDisplayValue(GEPlatformEncryptedValueDecorator.java:85)
 
My understanding is that the stack trace says the error comes from an encrypted field. And in fact, the data that we receive comes in the form of an email. Then, with a script include we extract the data (client name, address, DOB) and insert it into a form. The data has an encrypted field (DOB).
 
The error also references a call to gr.updateWithReferences() in our script include (not mentioned in the above excerpt).
SN people would not help me with this as  the issue is " related to a customization/implementation issue. which unfortunately falls outside of the scope of Technical Support."
So I am asking 2 questions:
1 - Is my assumption true: that this error comes from the encrypted field, that somehow the field cannot be inserted/decrypted.
2. If this is related to the call to : gr.updateWithReferences(): is there a way to rewrite the same logic without the updateWithReferences()?
 
Thanks
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Hamid,

that could be because of encryption of that field and value being set; you can set the value inside the field which is encrypted; system will take care of encryption

https://hi.service-now.com/kb_view.do?sysparm_article=KB0719974

regarding updateWithReferences() that should not be an issue

try adding try catch block to handle exception so as to know the exact issue

Is the script executed in scoped application?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks for your reply. I don't understand when you say "you can set the value inside the field which is encrypted;" What do you mean "inside the field" ? Can you give me an example?

Yes the script is executed in a scoped application.

Thanks

Omar

 

 

Hi Hamid,

you can set the value in encrypted field means you can use below syntax

gr.password = 'abc';

what system does is it automatically encrypts the value abc to some other value; you need not care about this

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader