- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 09:13 PM
Hi,
What is the replacement of GlideURI API, since it's is generating warning logs - Null Pointer exception error can't convert null to an object so do we have replacement of it so that we can avoid those logs. I have used it in my BR.
Thanks,
Anmol
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 12:12 AM
Hello Anmol,
This is the expected behaviour and ServiceNow suggests that it should not be executed during export or any background job.
Please check the article I've posted in the above thread.
Hope this helps.
Regards
Omkar Mone

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 09:29 PM
Hi Anmol
-
public class GlideUrl extends java.lang.Object implements Key
A wrapper for strings representing http/https URLs responsible for ensuring URLs are properly escaped and avoiding unnecessary URL instantiations for loaders that require only string urls rather than URL objects.Users wishing to replace the class for handling URLs must register a factory using GlideUrl.
To obtain a properly escaped URL, call
toURL()
. To obtain a properly escaped string URL, calltoStringUrl()
. To obtain a less safe, but less expensive to calculate cache key, callgetCacheKey()
.This class can also optionally wrap
Headers
for convenience.https://bumptech.github.io/glide/javadocs/490/com/bumptech/glide/load/model/GlideUrl.html
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 10:17 PM
Hi Gaurav,
Thanks for sharing this but I'm unable to achieve the functionality through the BR, I call toUrl, toStringUrl but unable to get the URL.
Thanks,
Anmol

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 09:44 PM
Hello Anmol,
Could share your code snippet with us so that we can help you triage/solve the issue, Is it a Query BR?
Please check the below article as well -
https://hi.service-now.com/kb_view.do?sysparm_article=KB0623094
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 10:20 PM
Hi Omkar,
Yes it is before Query BR on cmdb_ci table. code for the BR is as follows -
(function executeRule(current, previous /*null when async*/) {
var referer = GlideTransaction.get().getRequest().getHeader("referer");
//gs.addInfoMessage("answer " + ref);
if(typeof referer != "undefined" && referer.indexOf('http'));
var uri = gs.action.getGlideURI().toString();
if(typeof uri != "undefined" && (uri.indexOf('change_request.cmdb_ci') > -1))
current.addQuery('sys_class_name','cmdb_ci_service');
//if(current == null)
//return;
//gs.addInfoMessage("answer " + current);
})(current, previous);
Thanks,
Anmol