Command line dataloader in Salesforce – Solve Common errors

I had this article in my list for long time and today i got chance to share with you all. Data Loader is great native tool provide by the Salesforce to insert, upsert, update, export and delete data. Standard Data Loader wizard needs interaction however there are many scenarios where we need to perform these data loading tasks repeatedly like every night 1:00 AM (Nightly Services) or something. So, for these situations we can use standard data loader tool from Command line.

In this article, i will explain in detail on how to use Data Loader from command line.

The most important part of setting up Command line Data loader is to generate the encrypted password using utility provided by the Data Loader.

Commandline Data Loader tools
Commandline Data Loader tools

This directory contains two utility batch file : “encrypt.bat” and “process.bat”

Navigate to “Program Files | Data Loader | bin” in command prompt and run command.

encrypt.bat –g YOURSECRETKEY
Generate Secret Key for Command Line Dataloader
Generate Secret Key for Command Line Dataloader

The secrete key provided can be anything of your choice. Copy the generated Text highlighted in White color and paste in new file “Key.txt“.

Now run again above command to generated encrypted password with following command:

encrypt.bat -e password "C:Users\shiva\Desktop\Data Loader Documents\Try\Key.txt"
Commandline Data Loader generate Encrypted Password
Commandline Data Loader generate Encrypted Password

Now, note this password somewhere, as it is going to be used in remaining part of configuration.

Make sure that password generated is correct by checking below command, it will say password Matched or not :

encrypt.bat -v generatedPassword actualPassword secretKeyFilePath

If you are using proxy server and it uses the password, then repeat same step for generating encrypted password.

Salesforce command line dataloader - verify encrypted text
Salesforce command line dataloader – verify encrypted password

Additionaly, if we type only encrypt.bat without any parameter, it will show all the available options with help text.

Create file – “config.properties”:

This file contains all the common configurations settings like UserName, encrypted password. This file can also be kept as blank however it is good practice to write all common configurations in this file. Keys in this file will be same as of “Process-config.xml” as described at the end of this article.

Example:

#Loader Config
#Wed Sep 19 2012
sfdc.debugMessages=true
process.encryptionKeyFile=C:\Users\shiva\Desktop\Data Loader Documents\Try\Key.txt
sfdc.debugMessagesFile = C:\Users\shiva\Desktop\Data Loader Documents\Try\AccountExport.log
sfdc.endpoint=https://login.salesforce.com
sfdc.username=ilovenagpur@gmail.com
sfdc.password=7b5693f0cad856dc778d4b8506f2c976
sfdc.proxyUsername=proxyUserName
sfdc.proxyPassword=encrypytesPassword
sfdc.proxyHost=proxyhostName
sfdc.proxyPort=123
sfdc.loadBatchSize=200
sfdc.timeoutSecs=600

Create file – “process-conf.xml” :

This file contains all the information regarding import or export. In this article I am exporting the Account data, so sample file is

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="Account"
	class="com.salesforce.dataloader.process.ProcessRunner"
	singleton="false">
		<description>Export Account Data</description>
		<property name="name" value="Account"/>
		<property name="configOverrideMap">
		<map>
			<entry key="sfdc.enableLastRunOutput" value="false"/>
			<entry key="sfdc.entity" value="Account"/>
			<entry key="process.operation" value="extract"/>
			<entry key="sfdc.extractionRequestSize" value="500"/>
			<entry key="sfdc.extractionSOQL" value="SELECT Id FROM Account"/>
			<entry key="dataAccess.name" value="D:\Data Load\Seed Data\Jit\Production - 16 Aug 12AccountExport.csv"/>
			<entry key="dataAccess.type" value="csvWrite"/>
			<entry key="dataAccess.writeUTF8" value="true" />
		</map>
		</property>
	</bean>
</beans>

At the end of this article, you can see the description of all parameters. Assuming that we are inside the bin folder of dataloader then run below Command:

Process.bat "directory path where we have file process-config.xml"  process Name

In our case the process name is Account, process name is nothing but the property “name”.

Run Commandline Data Loader
Run Commandline Data Loader

After running the above command your data will be exported in file provided in configuration “process-config.xml” file.

While working with command line dataloader, there are chances that you get few error. So i am also inclusing few common error and there solutions:

Error 1:
Dataloader error: “javax.crypto.BadPaddingException:”Or error loading parameter of sfdc.password
Solution :
Add “process.encryptionKeyFile=C:\Users\315447\Desktop\Data Loader\key.txt” Either in “config.properties” or “process-conf.xml”

<entry key="process.encryptionKeyFile" value="config/key.txt"/>

Error 2:
Error in query: query is empty
Solution:
Occurs, If “sfdc.extractionSOQL” key in beans node does not have valid SOQL.

Parameters for Process-config.xml:

Parameter
Description
<bean id=" PROCESSNAME " class="com.salesforce.lexiloader.process.ProcessRunner" singleton="false"> This first line uniquely defines the process in the XML file. This has to be unique and will be used to call the process later on. Only change the PROCESSNAME and leave all other parts the same.
<description> Your Description here </description>A description of the process.
<property name="name" value="PROCESSNAME "/>Copy the PROCESSNAME and place it in this parameter. This is used in the log files when debug messages are showing. This is the name that is shown on the debug logs.
<property name="configOverrideMap"> These two lines initiate the parameters for the process. They should not be changed and should always be the same.
<entry key="sfdc.debugMessages" value="false"/>Set this to True if you want detailed debug messages to appear in the command line.
<entry key="sfdc.debugMessagesFile" value="c:\\dataloader\\samples\\status\\accountMasterSoapTrace.log"/>Set the value to a directory and a file to keep the detailed log file in.
WARNING: This can create an extremely large file. Make sure that you have space on your hard drive before this is set.
<entry key="sfdc.endpoint" value="https://www.salesforce.com"/>Keep default, unless loading into Sandbox. for sandbox, it is test.salesforce.com.
<entry key="sfdc.username" value="jitendrazaa@winter13Sand.com" />Set this as the username of the user you are importing /exporting as.
<entry key="sfdc.password" value="b6b3016135f717754590a3e35b1db32b" /><br/> <entry key="process.encryptonKeyFile" value="C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\Key.txt" />See this article on how to create Encrypted password for Command line Dataloader in Salesforce
<entry key="sfdc.timeoutSecs" value="600"/>System time out value.
<entry key="sfdc.loadBatchSize" value="200"/>System batch load size.
<entry key="process.operation" value="extract" />Signifies the process being run.
Possible Values:
  • Extract
  • Insert
  • Delete
  • Upsert
<entry key="sfdc.entity" value="Account"/>Signifies the object that you are running this process for. This should be the API name of the object when you are running processes for custom objects.
<entry key="sfdc.extractionRequestSize" value="500"/>Batch size for extract processes only
This is the SOQL query run for extract processes. You can use the Data Loader GUI to generate the SOQL statement and conditions and simply cut and paste into this entry key.
<entry key="dataAccess.type" value="csvWrite" />Signifies the action when doing the process for Extract, Insert, Delete, Upsert. This key should be used in conjunction with the “process.operation” key.
Possible Values:
  1. csvRead
  2. csvWrite
  3. databaseRead
  4. databaseWrite

When using Extract processes, use csvWrite. When using Delete, Insert, and Upsert processes, use csvRead.
<entry key="dataAccess.writeUTF8" value="true" />When using a “csvWrite” dataccess type, set this to True when you want files to be extracted as UTF-8.
<entry key="dataAccess.name" value="<b>C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\extract.csv</b>" />Signifies the location and file name of the dataaccess type process. If running a csvRead, the process will look for the file in this location. If running a csvWrite, the process will replace the file in this location.
<entry key="process.mappingFile" value="<b>C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\upsert_mapping.sdl</b>"/>Signifies the location of a data loader mapping file. This is the same mapping file used when saving a mapping from the data loader GUI. This is required for insert, delete and upsert processes.
<entry key="sfdc.externalIdField" value="Customer_ID__c"/>Signifies the External ID field used for the upsert process. This is required for upserts.
<entry key="process.statusOutputDirectory" value="C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\logs\\" />Signifies the directory where the data loader success and error files will be created in.
<entry key="process.outputSuccess" value="C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\Logs\\csvUpsertProcess_success.csv" /><br/><br/> <entry key="process.outputError" value="C:\\Program Files\\salesforce.com\\Apex Data Loader 9.0\\test\\Logs\\csvUpsertProcess_error.csv" />Signifies the directory and filename where the success and error files will be created. If this key is not specified, the “process.statusOutputDirectory” key will contain similar filenames as ones generated by the data loader GUI.

Posted

in

by


Related Posts

Comments

82 responses to “Command line dataloader in Salesforce – Solve Common errors”

  1. Jerun Jose Avatar

    Hi, I am trying to connect to a MS Access DB using dataloader, but having difficulties with it. Do you have a database-conf.xml file which has the proper setting for an MS Access connection?

    1. Michael Rask Christensen Avatar

      Do you have a JDBC driver for MS Access?

  2. Priyanka vaid Avatar
    Priyanka vaid

    where to save process-conf.xml.

    1. JitendraZaa Avatar
      JitendraZaa

      In same folder where you have config.properties file

  3. Neha Reddy Vancha Avatar
    Neha Reddy Vancha

    Hai,,,when am running Process.bat file ,,,,i am getting this error ,,please help to solve this problem…it is taking process-conf.xml file 2 times in path when am running and showing File not found error…

    c:Program Filessalesforce.comApex Data Loader 23.0bin>process.bat “C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xml” accountinsert

    0 [main] INFO com.salesforce.dataloader.process.ProcessConfig – Loading process configuration from config file: C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml

    34 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader – Loading XML bean definitions from file [C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml]

    36 [main] ERROR com.salesforce.dataloader.process.ProcessConfig – Error loading process: accountinsert configuration from config file: C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml

    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml]; nested exception is java.io.FileNotFoundException: C:program filessalesforce.comApex Dat

    aloader 23.0testconfigprocess-conf.xmlprocess-conf.xml (The system cannot find the path specified)

    java.io.FileNotFoundException: C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml (The system cannot find the path specified)

    at java.io.FileInputStream.open(Native Method)

    at java.io.FileInputStream.(FileInputStream.java:106)

    at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:167)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)

    at org.springframework.beans.factory.xml.XmlBeanFactory.(XmlBeanFactory.java:68)

    at org.springframework.beans.factory.xml.XmlBeanFactory.(XmlBeanFactory.java:56)

    at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(ProcessConfig.java:79)

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:68)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:260)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:246)

    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:219)

    41 [main] FATAL com.salesforce.dataloader.process.ProcessRunner – Failed to create process

    com.salesforce.dataloader.exception.ProcessInitializationException: Error loading process: accountinsert configuration from config file: C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:72)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:260)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:246)

    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:219)

    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml]; nested exception is java.io.FileNotFoundException: C:program filessalesforce.c

    omApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml (The system cannot find the path specified)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:180)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)

    at org.springframework.beans.factory.xml.XmlBeanFactory.(XmlBeanFactory.java:68)

    at org.springframework.beans.factory.xml.XmlBeanFactory.(XmlBeanFactory.java:56)

    at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(ProcessConfig.java:79)

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:68)

    … 3 more

    Caused by: java.io.FileNotFoundException: C:program filessalesforce.comApex Dataloader 23.0testconfigprocess-conf.xmlprocess-conf.xml (The system cannot find the path specified)

    at java.io.FileInputStream.open(Native Method)

    at java.io.FileInputStream.(FileInputStream.java:106)

    at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:167)

    … 8 more

    Thanks in Advance..

    1. PK Avatar
      PK

      I am also getting same error….path not found…..oops!

      1. JitendraZaa Avatar
        JitendraZaa

        Can you check that config files in proper directory ?

    2. civichief Avatar
      civichief

      maybe change all the pathes like:
      //computername/c$/path…..

      worked for me with the Data Loader Batch downloaded in May 2015 from salesforce.com

  4. Geoff Thorpe Avatar
    Geoff Thorpe

    Am I correct in assuming the v27.0.1 (and possibly other versions) require that the config.properties files doe snot contain path names?

  5. Ankita Singh Avatar
    Ankita Singh

    Hi Jitendra , need to know how to insertupsert detail object records using parent object external id , using command line data loader . I tried doing that and getting error :

    Field name provided, Ext_id__c does not match an External ID for childobject__c

    I’m a little confused why the error suggests the external Id is on the “Childobject” object.

  6. Arpit Agarwal Avatar
    Arpit Agarwal

    Hi Jitendra,

    I was facing Error 1: Dataloader error: “javax.crypto.BadPaddingException when trying to run the batch through Data loader CLI.

    The resolution mentioned by you worked and now it is running fine after adding “process.encryptionKeyFile” reference in my process-config.xml file.

    But earlier I do not had to add that reference in my XML file and it used to work just fine so i want to know that why do I had to add it this time around. Please let me know the root cause of this issue.
    It is very important for me and any help on this would be appreciated.

    1. Jitendra Zaa Avatar

      Hi Arpit,
      Not sure how it worked previously, it happened to me also. I also started getting this error and once i resolved it, this article was updated. I am glad it helped you. I guess may be because of Dataloader jar file update.

  7. sourabh Avatar
    sourabh

    Hi,

    2015-03-02 05:58:23,138 INFO [databaseAccountExtract] progress.NihilistProgressAdapter setSubTask (NihilistProgressAdapter.java:73) – Processed 500 of
    6,859 total records. Rate: 3,000 records per hour. Estimated time to complete: 101 minutes and 51 seconds. There are 500 successes and 0 errors.
    2015-03-02 05:58:23,154 ERROR [databaseAccountExtract] action.AbstractAction handleException (AbstractAction.java:198) – Exception occured during loadi
    ng
    com.salesforce.dataloader.exception.ExtractException: java.net.SocketException: Connection reset

    only 500 records are coming successfully after that socket timeout exception.

    1. Jitendra Zaa Avatar

      Hi sourabh, is it everytime or occasionally?

  8. Cyrille Avatar
    Cyrille

    Hi,

    “Error loading parameter: sfdc.password of type: java.lang.String”

    I don’t understand, i have copied the whole config.properties.

    I have tested my encrypted passwords with encrypt.bat -v generatedPassword secretKey

    I must say that if i don’t use config.properties but only process-conf.xml with the goods parameters It works…

    Any help would be appreciated.

    Thanks !

    1. Jitendra Zaa Avatar

      Can you confirm your Path ?

  9. Ricardo Avatar
    Ricardo

    Hello everybody!

    @JitendraZaa:disqus, how can I create a .bat file to run 5000k select queries in dataloder cliq?

    I have a list (excel) with the 5000k queries but now I need to create a process to run this 5000 queries at once.

    Can you please help me?

    Thank You very much in advance,

    Ricardo.

    1. Jitendra Zaa Avatar

      it 5000k queries or records ?

      1. Ricardo Avatar
        Ricardo

        5000k queries

        1. Jitendra Zaa Avatar

          Wow.. I am not sure what is your business justification. But you can use ANT to iterate 5000k times to your Dataloader command and execute one after another, However be ready that it may take days to execute depending on your data. You can refer this article to know how to use ANT with dataloader : https://www.jitendrazaa.com/blog/salesforce/automate-command-line-dataloader-using-ant-with-dynamic-arguments-and-query/

          1. Ricardo Avatar
            Ricardo

            Thank you.

            Yes, I know that it will take a long time, bur it is only a sample (100 rows for each 5000 fields).

            Is it something like this?:

            target name=”all”>

            96 ”

            100 userName=”${sf.prod.profileName.username}”

            101 password=”${sf.prod.profileName.password}”

            102 serverURL=”${sfProd.serverurl}”

            103 batchSize=”200″

            104 limit = “1000” />

          2. Jitendra Zaa Avatar

            Thats right, kinda this. ANT is very powerful and you can plug bits and pieces of ANT and dataloader together to achieve your solution.

          3. Ricardo Avatar
            Ricardo

            Thank You.

            Ricardo

  10. Chris Avatar
    Chris

    Hi Jitendra, thanks for the detail approach, why am executing final step “process.bat” am getting error.

    C:Desktopsalesforce.comData Loaderbin>process.bat “C:Usersk

    bogavelDesktopData Loader Documents” Account

    2015-06-19 12:16:22,023 INFO [main] controller.Controller initLog (Controller.j

    ava:389) – Using built-in logging configuration, no log-conf.xml in C:Userskbo

    gavelDesktopsalesforce.comData Loaderbinlog-conf.xml

    2015-06-19 12:16:22,028 INFO [main] controller.Controller initLog (Controller.j

    ava:391) – The log has been initialized

    2015-06-19 12:16:22,033 INFO [main] process.ProcessConfig getBeanFactory (Proce

    ssConfig.java:103) – Loading process configuration from config file: C:Userskb

    ogavelDesktopData Loader Documentsprocess-conf.xml

    2015-06-19 12:16:22,098 INFO [main] support.AbstractApplicationContext prepareR

    efresh (AbstractApplicationContext.java:495) – Refreshing org.springframework.co

    ntext.support.FileSystemXmlApplicationContext@cd5f8b: startup date [Fri Jun 19 1

    2:16:22 EDT 2015]; root of context hierarchy

    2015-06-19 12:16:22,136 INFO [main] xml.XmlBeanDefinitionReader loadBeanDefinit

    ions (XmlBeanDefinitionReader.java:315) – Loading XML bean definitions from URL

    [file://C:/Desktop/Data Loader Documents/process-conf.xml]

    2015-06-19 12:16:31,806 ERROR [main] process.ProcessConfig getProcessInstance (P

    rocessConfig.java:96) – Error loading process: Account configuration from config

    file: C:DesktopData Loader Documentsprocess-conf.xml

    org.springframework.beans.factory.BeanDefinitionStoreException: IOException pars

    ing XML document from URL [file://C:/Desktop/Data Loader Document

    s/process-conf.xml]; nested exception is java.net.UnknownHostException: C

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:341)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:302)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)

    at org.springframework.context.support.AbstractXmlApplicationContext.loa

    dBeanDefinitions(AbstractXmlApplicationContext.java:127)

    at org.springframework.context.support.AbstractXmlApplicationContext.loa

    dBeanDefinitions(AbstractXmlApplicationContext.java:93)

    at org.springframework.context.support.AbstractRefreshableApplicationCon

    text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)

    at org.springframework.context.support.AbstractApplicationContext.obtain

    FreshBeanFactory(AbstractApplicationContext.java:522)

    at org.springframework.context.support.AbstractApplicationContext.refres

    h(AbstractApplicationContext.java:436)

    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)

    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:84)

    at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces

    sConfig.java:105)

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr

    ocessConfig.java:93)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu

    nner.java:287)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu

    nner.java:273)

    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja

    va:246)

    Caused by: java.net.UnknownHostException: C

    at java.net.PlainSocketImpl.connect(Unknown Source)

    at java.net.SocksSocketImpl.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at sun.net.NetworkClient.doConnect(Unknown Source)

    at sun.net.NetworkClient.openServer(Unknown Source)

    at sun.net.ftp.FtpClient.openServer(Unknown Source)

    at sun.net.ftp.FtpClient.openServer(Unknown Source)

    at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)

    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour

    ce)

    at org.springframework.core.io.UrlResource.getInputStream(UrlResource.ja

    va:125)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:328)

    … 17 more

    2015-06-19 12:16:31,810 FATAL [main] process.ProcessRunner topLevelError (Proces

    sRunner.java:238) – Failed to create process

    com.salesforce.dataloader.exception.ProcessInitializationException: Error loadin

    g process: Account configuration from config file: C:DesktopDat

    a Loader Documentsprocess-conf.xml

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr

    ocessConfig.java:97)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu

    nner.java:287)

    at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu

    nner.java:273)

    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja

    va:246)

    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOExc

    eption parsing XML document from URL [file://C:/Desktop/Data Load

    er Documents/process-conf.xml]; nested exception is java.net.UnknownHostExceptio

    n: C

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:341)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:302)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

    r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)

    at org.springframework.context.support.AbstractXmlApplicationContext.loa

    dBeanDefinitions(AbstractXmlApplicationContext.java:127)

    at org.springframework.context.support.AbstractXmlApplicationContext.loa

    dBeanDefinitions(AbstractXmlApplicationContext.java:93)

    at org.springframework.context.support.AbstractRefreshableApplicationCon

    text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)

    at org.springframework.context.support.AbstractApplicationContext.obtain

    FreshBeanFactory(AbstractApplicationContext.java:522)

    at org.springframework.context.support.AbstractApplicationContext.refres

    h(AbstractApplicationContext.java:436)

    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)

    at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:84)

    at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces

    sConfig.java:105)

    at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr

    ocessConfig.java:93)

    … 3 more

    Caused by: java.net.UnknownHostException: C

    at java.net.PlainSocketImpl.connect(Unknown Source)

    at java.net.SocksSocketImpl.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at sun.net.NetworkClient.doConnect(Unknown Source)

    at sun.net.NetworkClient.openServer(Unknown Source)

    at sun.net.ftp.FtpClient.openServer(Unknown Source)

    at sun.net.ftp.FtpClient.openServer(Unknown Source)

    at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)

    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour

    ce)

    at org.springframework.core.io.UrlResource.getInputStream(UrlResource.ja

    va:125)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

    nDefinitions(XmlBeanDefinitionReader.java:328)

    … 17 more

    C:Desktopsalesforce.comData Loaderbin>

    1. Jitendra Zaa Avatar

      Hi Chris,

      Format of XML file “process-conf.xml” is not correct or is not expected. Please check if this XML is in correct format.

      1. karthik neo Avatar
        karthik neo

        hi Jitendra,

        i too have the same issue running in my system. i tried with the proper XML format but still it is throwing the same exception. Is there any work around for that?

        1. Jitendra Zaa Avatar

          Can you check path for key file is correct with folder + file name. There may be multiple of reasons of this.

          1. Ben Clinton Avatar
            Ben Clinton

            Hi Jitendra
            I have the same issue i have correct proper XMl format i give correct path but the same issue happen please provide any solution

  11. Akshay Avatar
    Akshay

    Hi All,
    I have a question, How do you get to know that process is complete?
    I have scheduled a bat file to insert various sObject’s data daily but how do i know that process is complete

    1. Jitendra Zaa Avatar

      You can take help of ANT tasks. Use Dataloader from ANT and you can use various ANT tasks like send email. This article may give you heads up on using Dataloader and ANT together, https://www.jitendrazaa.com/blog/salesforce/using-dataloader-and-ant-to-backup-salesforce-data-on-ftp-server-video/

  12. Jacky Avatar
    Jacky

    Hi All,

    I am getting following error while executing

    C:Program Files (x86)salesforce.comData Loaderbin>encrypt.bat -v c95b705b441a10edf25aee16fafb5fd1 test

    2015-08-20 06:07:46,567 ERROR [main] security.EncryptionUtil main (EncryptionUtil.java:336) – Error decrypting string: c95b705b441

    a10edf25aee16fafb5fd1, error: Given final block not properly padded.

    Thanks,

    Jacky

    1. Jitendra Zaa Avatar

      Above command seems you try to check if generated password is correct with secret key “test”, Can you check your key file has any space or something. If you follow all steps it should work. Also, make sure there are no unused files in directory, sometimes it conflicts.

    2. "Red" Murphy Avatar
      “Red” Murphy

      Did you find a solution to this problem?

    3. Tex Murphy Avatar
      Tex Murphy

      Did you find a solution to this problem?

  13. bruno brancati Avatar
    bruno brancati

    Hi All,

    I configured as specified in this article, but I’m getting this error in log file:

    2015-09-08 13:18:20,128 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) – Failed to create process

    com.salesforce.dataloader.exception.ProcessInitializationException: Error loading process: csvAccountExtractProcess configuration from config file: C:UsersspadminsvilDesktopDataLoaderprocess-conf.xml

  14. Roy Avatar
    Roy

    Hi All ,
    Can i use the Data Loader command line, if i have those files available on the shared netwrok ? for the upload on the salesforce ?

  15. Roy Avatar
    Roy

    Let me Explain the whole scenario :
    One of the Application is generating two files and those files are saved on the shared netwrok of the client, prior it was a manual process using data loader we were able to upload the records on the salesforce but now we want to automate the whole process can i use the Data Loader CLI to automate it. is it going to fetch those files from the shared netwrok ? if yes how it will gonna work ? Please explain . Thanks .

  16. nav Avatar
    nav

    Can we run data loader on Linux server?

    1. Jitendra Zaa Avatar

      I didn’t tried, but should run because its java app

  17. Ryan P. Avatar
    Ryan P.

    When encrypting the password, is it just your password alone, or is it the combination of password/security key that Data Loader requires when using the GUI?

  18. Priscilla Avatar
    Priscilla

    Hi Jitendra,
    I wanted to send an email to certain ppl with the failed record count in automated command line data loader process? Will it be possible to do it using Ant?

  19. Merul Shah Avatar
    Merul Shah

    @JitendraZaa:disqus: Just to add, CLIq will be the great add on to above process and it make the process UI friendly.
    Can you highlight some cases which cannot be done by CLIq because of which we need to come to basic config of CLI?

    1. Jitendra Zaa Avatar

      Hey Merul, can you post URL of CLIq ? Have not heard about it and thanks for letting me know

  20. Pavan Avatar
    Pavan

    Hi Jitendra ,

    Where do we add the proxy password. Is it in the same key file as the sfdc password or is there a separate file which we need to create ?

    1. Jitendra Zaa Avatar

      It needs to be in “config.properties”. check line 9-10 in this post.

  21. tanu dua Avatar
    tanu dua

    I am There on this Step when using the DAta Laoder CLI bt what is the Next Steps?
    Please Guide me/
    encrypt.bat -v generatedPassword secretKey

  22. Gaurav Nawal Avatar
    Gaurav Nawal

    Hi Jitendra,

    thank you for sharing this excellent article which greatly helped me in building a data integrations for one of my clients. However when the password has been reset for the salesforce account that I was using to sign in, I am unable to encrypt it properly again. I am getting an error while checking the encrypted string stating “Given final block not properly padded”.

    I have followed all the steps given here almost 10 times now. I can share the details if required.

    Could you please help?

    Thank you.

    1. Jitendra Zaa Avatar

      Hi Gaurav,
      I would suggest to delete all files from folder and create fresh key file, fresh config, it should fix your issue

      1. Gaurav Nawal Avatar
        Gaurav Nawal

        Thanks Jitendra, it did help in resolving the issue. Though this is a strange way.

      2. anurag dubey Avatar
        anurag dubey

        HI Jitendra

        As suggested, I followed the same steps, but still facing the same issue. Could you please help me in its resolution since I have a very close go-live date.
        Resolution steps I tried:
        1. Creating New Folder and New File for Key file.
        2. Uninstalling and re-installing Data Loader.

        Waiting in anticipation.

  23. Tex Murphy Avatar
    Tex Murphy

    Can you help with a Data Loader problem?

  24. Hamish Avatar
    Hamish

    Excellent Article,
    was able to troubleshoot my issue thanks to your sound advise

  25. Chandra Avatar
    Chandra

    Hi Jitendra, very helpful article.

    I would like to create a process to extract data from a custom object and I would like to schedule this to run 1st of every month. I would basically like to extract last year’s last months data. For example, if the job runs on July 1st, 2017, I want to extract records that were created in June, 2016. Could you please help me with the SOQL for this? Thank you!

    1. Raj Avatar
      Raj

      Hi Chandra,

      Were you able to achieve this by anyways, if you did, please can you share the approach you have taken to get his run automatically. Also, were you saving the extracts somewhere on SFTP?

  26. Pankaj Pandey Avatar
    Pankaj Pandey

    Hi Jitendra,
    I am using CLI for data loader version 40. When i am giving encrypt.bat -g key.txt it is giving me an error that “The system path is not specified.” Can you please guide me what could be the possible reason for the same. I have checked my java and it is installed correctly and working fine.

    Thanks in advance.
    Pankaj

    1. Jitendra Zaa Avatar

      last parameter needs to be string and not path. can you confirm ?

  27. Raj Avatar
    Raj

    Hi Jitendra,
    Can you tell me if I can give and SFTP location to save the extracted file under process-conf.xml file?
    Also, does task scheduler help to run these batch jobs nightly. is it possible?

  28. Manoj sharma Avatar
    Manoj sharma

    I’m getting commandline proxy authentication issue: Please help me resolve the issue

    2018-03-09 11:24:46,499 WARN [csvAccountExtract] auth.HttpAuthenticator generateAuthResponse (HttpAuthenticator.java:207) – NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))
    2018-03-09 11:24:46,500 WARN [csvAccountExtract] auth.HttpAuthenticator generateAuthResponse (HttpAuthenticator.java:207) – KERBEROS authentication error: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
    2018-03-09 11:24:46,501 WARN [csvAccountExtract] auth.HttpAuthenticator generateAuthResponse (HttpAuthenticator.java:207) – NTLM authentication error: Credentials cannot be used for NTLM authentication: org.apache.http.auth.UsernamePasswordCredentials
    2018-03-09 11:24:46,588 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) – Unable to run process csvAccountExtract
    java.lang.RuntimeException: java.lang.RuntimeException: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:162)
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
    Caused by: java.lang.RuntimeException: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
    at com.salesforce.dataloader.client.HttpClientTransport.getContent(HttpClientTransport.java:138)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:97)
    at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:818)
    at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:161)
    at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:152)
    at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerClient.java:328)
    at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerClient.java:524)
    at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.java:492)
    at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.java:213)
    at com.salesforce.dataloader.controller.Controller.login(Controller.java:173)
    at com.salesforce.dataloader.controller.Controller.login(Controller.java:168)
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:128)

    1. Navya Avatar
      Navya

      Did it solved because I am getting same error

  29. Manny Avatar
    Manny

    Hi am getting the result below after I run the process.bat command – seems like I have everything I need in place, just not sure why my csv extract does not show up where its supposed to:

    Usage: java [-options] class [args…]
    (to execute a class)
    or java [-options] -jar jarfile [args…]
    (to execute a jar file)
    where options include:
    -d32 use a 32-bit data model if available
    -d64 use a 64-bit data model if available
    -client to select the “client” VM
    -server to select the “server” VM
    The default VM is client.

    -cp
    -classpath
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D=
    set a system property
    -verbose:[class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:
    Warning: this feature is deprecated and will be removed
    in a future release.
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
    Warning: this feature is deprecated and will be removed
    in a future release.
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:…|:]
    -enableassertions[:…|:]
    enable assertions with specified granularity
    -da[:…|:]
    -disableassertions[:…|:]
    disable assertions with specified granularity
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:[=]
    load native agent library , e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:[=]
    load native agent library by full pathname
    -javaagent:[=]
    load Java programming language agent, see java.lang.instrument
    -splash:
    show splash screen with specified image
    See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
    C:\Users\ma5113\Desktop\Data Loader Local\bin>

  30. SANKET V Avatar
    SANKET V

    Hi Jitendra, is there a way to specify a parameter for folder name where the file will be created?

    e.g. {$FolderPath}\Account.csv

    How can I pass a folder path?

    Thanks

  31. Andy (@Amancs_17) Avatar

    Tried the above, apparently i got a message that I need the Salesforce token as well

    ERROR [sf_existing_orgs] client.PartnerClient runOperation (PartnerClient.java:332) – Error while calling web service operation: login, error was:
    [LoginFault [ApiFault exceptionCode=’LOGIN_MUST_USE_SECURITY_TOKEN’

    1. Mahdi Ghariani Avatar
      Mahdi Ghariani

      Hello Andy,
      I’m getting the same error !! did you find a solution ?

  32. Raj Avatar
    Raj

    Hi Jitendra,

    Thanks for such an elaborative posts. However, i am facing a situation now. I am trying to upsert data and have everything setup but when i ran the file, i am getting an error called “Attribute value “EventReg__c” of type ID must be unique within the document. when it said document, i assume the file that has my records, so for this i only have three records which have all unique value, i am not getting where i went wrong, can you please help.

    Thanks,
    Raj

  33. apoorva Avatar
    apoorva

    Hi Jitendra,

    I allowed the above steps and everything went smooth except for one issue the object into which i am trying to insert data there is only one required field on the layout and i gave that but yet it is still throwing an error saying one required field missing. I went back on salesforce end and checked why it is blocking, there is a ‘Name’ Auto Number required field, but since it is auto number we do not have to explicitly specify it right it should automatically append when it inserts the record right. I did the same through data loader applications and it successfully passed through, but with cmd it is not can anyone help with this.

    Thanks.

    1. Raj Avatar
      Raj

      You have to give the name of the field in you .sdl field and do the insert. Try that and let me know if it worked, when inserting, though you are not really should have the Id field and fields like Name, you should have them in your .sdl.

  34. Ayush Nigam Avatar
    Ayush Nigam

    Hi Jitendra,
    I am using version 44 and I am getting error saying Unsupported Option : -g when I am running encrypt.bat -g mysecretkey. I don’t know where am I going wrong.

    1. Raj Avatar
      Raj

      Hi Ayush,

      Can you give more specifics on this issue! are you trying to generate a key or trying to encrypt a password, what are you exactly tring. Also did you see if the native dataloader application is loading fine when you tried to open it? Please let me know

      Thanks,
      Raj

      1. Ayush Nigam Avatar
        Ayush Nigam

        Hi Raj, I couldn’t go that further. I got this error right in the step 1 where I was trying to generate an encryption key using -g handle. And in the next step I would be able to encrypt my password using key.txt file.
        Regards,
        Ayush

        1. Raj Avatar
          Raj

          Did you go to the path specific where your dataloader encrypt.bat file exists?

          “C:\Program Files (x86)\salesforce.com\Data Loader\bin” .. You should be on this this path and then you have to enter the command.

          1. Raj Avatar
            Raj

            Also did you see if the encrypt.bat file has the required script in it, sometime the .bat file will be empty and you wont be able to generate the key. Right click the .bat file and see if the script exists, if you see the file blank, then uninstall and re-install dataloader

  35. Ayush Nigam Avatar
    Ayush Nigam

    Hi Raj,
    Batch file is also good. It somehow worked when I copied the folder in c:/ and removed the space from the name. Also, changed the path and folder name everywhere in the script.
    Thanks for the support.
    Regards,
    Ayush

    1. TMJ Avatar
      TMJ

      Hi Raj, Ayush,

      I am facing the same problem with encrypt.bat -g mykey. Everything looks fine from the configuration end. I have also tried Ayush’s resolution but it didn’t help me. Could you please help me out?

      1. Victor Ng Avatar
        Victor Ng

        Yes his guide is outdated. -g is no longer supported

        1. shrradhaa Avatar
          shrradhaa

          Is there any alternative available?
          I am getting Error: Could not find or load main class com.salesforce.dataloader.security.EncryptionUtil
          I tried c:\..\dataloader\v47.0.0\bin>encrypt -g secretKey with v47 and v50.

  36. athi Avatar
    athi

    soql=”SELECT CreatedById,CreatedDate,et4ae5__CampaignMemberId__c,et4ae5__Clicked__c,et4ae5__Contact_ID__c,et4ae5__Contact__c,Name,OwnerId,Sent_in_Last_365_Days__c,SystemModstamp FROM et4ae5__IndividualEmailResult__c WHERE et4ae5__DateSent__c = LAST_N_MONTHS:4 AND et4ae5__DateSent__c < LAST_N_MONTHS:3 "
    userName="${sf.prod.profileName.username}"
    password="${sf.prod.profileName.password}"
    serverURL="${sf.serverurl}"
    batchSize="200"

    The < symbal is not supported. Anyone know how to use < in build.xml file? I tried escape string & lt; however not helpful

    1. Raj Avatar
      Raj

      double quote before Select statement does not work, the quotes should be similar to like the others in the query

  37. shrradhaa Avatar
    shrradhaa

    Hello,

    I am working with data loader v47.
    dataloader\v47.0.0\bin>encrypt -g testing
    Error: Could not find or load main class com.salesforce.dataloader.security.EncryptionUtil

    and getting exception in first step only.
    Could you please help me?

    1. Eric Eskildsen Avatar
      Eric Eskildsen

      @shrradhaa Check line 9 of your encrypt.bat. You should see a path after -cp. Does that file exist?

  38. Navya Avatar
    Navya

    Please help me with the error I did same steps for user insertion it worked but for family insertion it is giving below error :
    C:\Softwares\v54.0.0\bin>process.bat “D:\TestData” familyStagingInsert
    WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
    18:29:33.652 [main] FATAL com.salesforce.dataloader.process.ProcessRunner – Unable to run process
    java.lang.RuntimeException: java.lang.NullPointerException
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:181) ~[dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.process.ProcessRunner.runBatchMode(ProcessRunner.java:262) [dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.process.ProcessRunner.runBatchMode(ProcessRunner.java:246) [dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.process.DataLoaderRunner.main(DataLoaderRunner.java:104) [dataloader-54.0.0-uber.jar:?]
    Caused by: java.lang.NullPointerException
    at java.lang.String$CaseInsensitiveComparator.compare(String.java:1224) ~[?:?]
    at java.lang.String$CaseInsensitiveComparator.compare(String.java:1218) ~[?:?]
    at java.util.TreeMap.put(TreeMap.java:550) ~[?:?]
    at java.util.TreeSet.add(TreeSet.java:255) ~[?:?]
    at java.util.AbstractCollection.addAll(AbstractCollection.java:352) ~[?:?]
    at java.util.TreeSet.addAll(TreeSet.java:312) ~[?:?]
    at com.salesforce.dataloader.mapping.Mapper.(Mapper.java:88) ~[dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.mapping.LoadMapper.(LoadMapper.java:55) ~[dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.controller.Controller.createMapper(Controller.java:264) ~[dataloader-54.0.0-uber.jar:?]
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:165) ~[dataloader-54.0.0-uber.jar:?]
    … 3 more

  39. Jon Raney Avatar

    For me, the oft-quoted encrypt.bat -g or encrypt -g doesn’t work currently. you are presented in response with an unsupported option. I have yet been able to get past the various errors, either with padding, can’t open file, etc.

    Utility to encrypt a string based on a static or a provided key
    Options (mutually exclusive – use one at a time):
    -e Encrypt a plain text value, keyfile path
    -d Decrypt an encrypted text back to plain text value using keyfile
    -k [Path to Keyfile] Generate keyfile with optional keyfile path

Leave a Reply to PKCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading