- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 12:26 AM
Hi,
I have uploaded the "Remote File Importer" update set.
Mid Server Path: E:\admin\Servicenow\agent\ it is a network location
File Path to import E:\admin\Servicenow\agent\import\test.csv
I can not see anything that happened when executed, I mean not importing anything.
Any ideas to work out this
Thanks,
Narsi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 06:08 AM
Hi,
seems some issue with java package call
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 12:59 AM
Hi,
you need to debug line by line. check the function which is getting called and debug that
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 05:00 AM
Hi
Thank you for replying
I have checked
I got a response from the log file as below, I put the mid server password instead of this.probeParameters.instancePassword and user name instead of this.probeParameters.instanceUser like
var userpass = new java.lang.String(t"MidServerUserName:MidServerPassword");
but no luck. any ideas?
08/20/20 12:35:53 (653) Worker-Standard:JavascriptProbe-6fe138f8dbbedc9444ce97f2f39619b6 WARNING *** WARNING *** org.mozilla.javascript.EcmaError: "java" is not defined.
Caused by error in MID Server script include 'CSMIDServerRemoteFileImport' at line 59
56: }
57: var conn = new Packages.java.net.URL(url).openConnection();
58: this.logMsg("Sending to : " + url, "debug");
==> 59: var userpass = new java.lang.String(this.probeParameters.instanceUser + ":" + this.probeParameters.instancePassword);
60: var basicAuth = "Basic " + (new Packages.javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes()) + '');
61: conn.setRequestProperty("Authorization", basicAuth);
62: conn.setDoOutput(true);
08/20/20 12:35:53 (653) Worker-Standard:JavascriptProbe-6fe138f8dbbedc9444ce97f2f39619b6 WARNING *** WARNING *** org.mozilla.javascript.EcmaError: "java" is not defined.
Caused by error in MID Server script include 'CSMIDServerRemoteFileImport' at line 18
15: },
16: getRemoteFileAndUploadToInstance: function() {
17: var url = this._getInstanceConnectionURL();
==> 18: var conn = this._getURLConnection(url);
19: var file = this._getFile();
20: var response = this._writeFile(conn, file);
21: if (response != 200)
08/20/20 12:35:53 (653) Worker-Standard:JavascriptProbe-6fe138f8dbbedc9444ce97f2f39619b6 WARNING *** WARNING *** org.mozilla.javascript.EcmaError: "java" is not defined.
Caused by error in JavaScript probe 'CSRemoteFileImport' at line 2
1: var remoteFileImport = new CSMIDServerRemoteFileImport();
==> 2: remoteFileImport.getRemoteFileAndUploadToInstance();
08/20/20 12:35:53 (653) Worker-Standard:JavascriptProbe-6fe138f8dbbedc9
Thanks,
Narsi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 06:08 AM
Hi,
seems some issue with java package call
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 06:32 AM
Hi
I have changed that to
Packages.java.lang.String(this.probeParameters.instanceUser + ":" + this.probeParameters.instancePassword);
then it works.
and I got another error:
var data = new Packages.java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 4096);
I have change it to
var data = Packages.java.lang.reflect.Array.newInstance(Packages.java.lang.Byte.TYPE, 4096);
It works now, I'm able to import from Mid Server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2020 08:43 AM
Great! It looks like you marked your own response as the correct answer, which may be confusing to others that read this later.
I felt I covered that above pretty well (first) regarding the java package call.
Would you mind marking my response as helpful/correct if I am able to resolve your query?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader