The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting Error while importing data from XML file

nehal2
Kilo Contributor

Hello,

I want create a data source for importing XML files. I have configured all but   the file path is not working . I am getting error when I load test data with this source file path: d:\request_xml.xml

Error:- com.glide.db.impex.datasource.DataSourceException: java.net.MalformedURLException: For input string: "\request_xml.xml"

I have tried changing the "\" to "/" but no success test load was possible.

Thanks!

Neha

4 REPLIES 4

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Neha,



Maybe this file d:\request_xml.xml is not accessible.


What is specified for the File retrieval method in the data source definition?



Best Regards



Tony


Hi Tony,


The XML file is accessible and about file retrieval method its File.


I have attached screenshot of the specification and file location.


find_real_file.png


Physical File Location:-


find_real_file.png


Regards,


Neha


tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Neha,


The file you are try to access is on a Windows host remote from the ServiceNow instance.


You need to specify a



Data Sources - ServiceNow Wiki


..


1 Overview


Data Sources is a module of the Import Sets application. Data sources are used to create an import set so that data can be processed, if necessary, prior to being mapped onto a production table. The data source type describes the origin of data:


  • File: Data is in a recognized file format, accessible locally or remotely through several file retrieval methods



Data Sources - ServiceNow Wiki


..


3 File Retrieval Methods


After defining the files that are compatible for importing, the next configuration step for the file data source is to define how the file can be imported. The following file retrieval methods are available to copy the file from where it resides to ServiceNow to be loaded into an import set.


...



Best Regards


Tony


Just to mention - if you specify File retrieval method of "File" the restrictions below apply


Data Sources - ServiceNow Wiki



MethodDescription
AttachmentAttach a file to the record and import that file in an import set.
FileSelect a file to import from a local drive or, less commonly, a network location. Selecting this method provides a field to specify the network path. Only these file locations are available, for increased security.
  • Tomcat home. For example, /Apache Tomcat.
  • Glide system home. For example, /<Tomcat home>/webapps/glide/itil/WEB-INF/.
  • Temporary directory. For example, /tmp or /var/tmp depending on how your system is configured.

If you need to specify an arbitrary network path, consider using a different file retrieval protocol such as FTP or SCP where you can secure the communications channel.