+ Start a Discussion
mac_046mac_046 

Error while running Data Loader through Command Line

Hi

 

I am trying to run the Data loader through command line and I am getting the following error. Can anyone help me where I am doing wrong.

 

ERROR MESSAGE:

 

C:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integration
>process.bat ./Config xnacMasterProcess
0 [main] INFO com.salesforce.dataloader.process.ProcessConfig  - Loading process
 configuration from config file: C:\Program Files\salesforce.com\Apex Data Loade
r 21.0\R4 Data Loader Integration\.\Config\process-conf.xml
78 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Dat
a Loader 21.0\R4 Data Loader Integration\.\Config\process-conf.xml]
78 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
 Using JAXP implementation [com.sun.org.apache.xerces.internal.jaxp.DocumentBuil
derFactoryImpl@1f42b49]
125 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
 Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and syste
m ID [http://www.springframework.org/dtd/spring-beans.dtd]
125 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
 Trying to locate [spring-beans.dtd] in Spring jar
141 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  -
 Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classp
ath
172 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Loading bean definitions
172 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Default lazy init 'false'
172 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Default autowire 'no'
172 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Default dependency check 'none'
188 [main] INFO org.springframework.core.CollectionFactory  - JDK 1.4+ collectio
ns available
203 [main] INFO org.springframework.core.CollectionFactory  - Commons Collection
s 3.x available
203 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
203 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionP
arser  - Found 1 <bean> elements in file [C:\Program Files\salesforce.com\Apex D
ata Loader 21.0\R4 Data Loader Integration\.\Config\process-conf.xml]
219 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Creatin
g instance of bean 'xnacMasterProcess' with merged definition [Root bean: class
[com.salesforce.dataloader.process.ProcessRunner]; abstract=false; singleton=fal
se; lazyInit=false; autowire=0; dependencyCheck=0; initMethodName=null; destroyM
ethodName=null; factoryMethodName=null; factoryBeanName=null; defined in file [C
:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integration\
.\Config\process-conf.xml]]
219 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before instantiation of bean 'xnacMasterProcess'
250 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Getting
 BeanInfo for class [com.salesforce.dataloader.process.ProcessRunner]
266 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Caching
 PropertyDescriptors for class [com.salesforce.dataloader.process.ProcessRunner]

266 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'class' of type [java.lang.Class]
266 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'configOverrideMap' of type [java.util.Map]
281 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'controller' of type [com.salesforce.dataloader.controller.Controller]
281 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found p
roperty 'name' of type [java.lang.String]
281 [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Class [
com.salesforce.dataloader.process.ProcessRunner] is cache-safe
281 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.ut
il.LinkedHashMap]
297 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setName(java.lang.String)] on object of class [com.salesforce.dataloader.pr
ocess.ProcessRunner]
297 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
Name(java.lang.String)] with value of type [java.lang.String]
297 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - About to invoke wr
ite method [public synchronized void com.salesforce.dataloader.process.ProcessRu
nner.setConfigOverrideMap(java.util.Map)] on object of class [com.salesforce.dat
aloader.process.ProcessRunner]
297 [main] DEBUG org.springframework.beans.BeanWrapperImpl  - Invoked write meth
od [public synchronized void com.salesforce.dataloader.process.ProcessRunner.set
ConfigOverrideMap(java.util.Map)] with value of type [java.util.Map]
313 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors before initialization of bean 'xnacMasterProcess'
313 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g afterPropertiesSet() on bean with name 'xnacMasterProcess'
313 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory  - Invokin
g BeanPostProcessors after initialization of bean 'xnacMasterProcess'
359 [xnacMasterProcess] ERROR com.salesforce.dataloader.config.Config  - Error i
nitializing encryption for key file C:\Program Files\salesforce.com\Apex Data Lo
ader 21.0\R4 Data Loader Integration\EncryptionKey.key: Cannot Access Key File:
C:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integration
\EncryptionKey.key
375 [xnacMasterProcess] FATAL com.salesforce.dataloader.process.ProcessRunner  -
 Unable to run process xnacMasterProcess
java.lang.RuntimeException: com.salesforce.dataloader.exception.ControllerInitia
lizationException: Error loading config file: C:\Program Files\salesforce.com\Ap
ex Data Loader 21.0\R4 Data Loader Integration\.\Config\config.properties.  Plea
se make sure that it exists and is readable
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:86)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: com.salesforce.dataloader.exception.ControllerInitializationException
: Error loading config file: C:\Program Files\salesforce.com\Apex Data Loader 21
.0\R4 Data Loader Integration\.\Config\config.properties.  Please make sure that
 it exists and is readable
        at com.salesforce.dataloader.controller.Controller.initConfig(Controller
.java:333)
        at com.salesforce.dataloader.controller.Controller.<init>(Controller.jav
a:95)
        at com.salesforce.dataloader.controller.Controller.getInstance(Controlle
r.java:199)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:84)
        ... 2 more
Caused by: com.salesforce.dataloader.exception.ConfigInitializationException: Er
ror initializing encryption for key file C:\Program Files\salesforce.com\Apex Da
ta Loader 21.0\R4 Data Loader Integration\EncryptionKey.key: Cannot Access Key F
ile: C:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integr
ation\EncryptionKey.key
        at com.salesforce.dataloader.config.Config.initEncryption(Config.java:70
2)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:616)
        at com.salesforce.dataloader.config.Config.load(Config.java:599)
        at com.salesforce.dataloader.config.Config.load(Config.java:575)
        at com.salesforce.dataloader.controller.Controller.initConfig(Controller
.java:327)
        ... 5 more
C:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integration
>

 

I have followed the following procedure

Generated an encrypted key and saved it in a file in .key format

encrypted my SFDC password along with security token using the encrypted key

created process.XML and Database.xml files

created config.properties file

when I tried to run the process.XML file through command prompt I am getting the above error message.

Follwing are the files I have created and placed then in a folder inside data loader folder

 

Process.XML file

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="xnacMasterProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <property name="name" value="xnacMasterProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.proxyHost" value="proxy host url"/>
                <entry key="sfdc.proxyPort" value="port number"/>
    <entry key="sfdc.endpoint" value="https://test.salesforce.com"/>
    <entry key="sfdc.username" value="test.user@mycompany.com"/>
                <entry key="sfdc.password" value="3b4c681773206eae857c4379730f9ddeb5c156a9a6b6fc2d338335aaf9c11b4bc2b15193613a5537"/>
                <entry key="process.encryptionKeyFile" value="C:\Program Files\salesforce.com\Apex Data Loader 21.0\R4 Data Loader Integration\Config\EncryptionKey.key"/>
                <entry key="sfdc.connectionTimeoutSecs" value="60"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
  <entry key="sfdc.entity" value="Account"/>
                <entry key="process.operation" value="extract"/>
                <entry key="sfdc.enableRetries" value="TRUE"/>
                <entry key="sfdc.maxRetries" value="3"/>
                <entry key="sfdc.minRetrySleepSecs" value="3"/>
                <entry key="dataAccess.name" value="queryXNAC"/>
                <entry key="dataAccess.type" value="databaseRead"/>
            </map>
        </property>
    </bean>
</beans>

 

Database.XML

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dbDataSource"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@(DESCRIPTION_LIST=(FAILOVER=TRUE) (LOAD_BALANCE=FALSE) (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 13.121.13.195 ) (PORT = 1245)) (CONNECT_DATA = (SID = TEST))
 (CONNECT_DATA=(SERVICE_NAME=HRGLOBAL) (SERVER=DEDICATED) (FAILOVER_MODE=(TYPE=SELECT) (METHOD=PRECONNECT) (RETRIES=20)(DELAY=30)))) (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 13.121.13.195 ) (PORT = 1245)) (CONNECT_DATA = (SID = TEST))
 (SERVER=DEDICATED)))"/>
    <property name="username" value="username"/>
    <property name="password" value="pwd"/>
</bean>
<bean id="queryXNAC"
      class="com.salesforce.dataloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="queryXNACSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="queryXNACSql"
      class="com.salesforce.dataloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            select parent3_xnac, parent3 from finaltable
        </value>
    </property>
    <property name="columnNames">
        <list>
        <value>parent3_xnac</value>
 <value>parent3</value>
        </list>
    </property>
</bean>
</beans>


Config.Properties

 

#Loader Config
sfdc.endpoint=https\://www.salesforce.com
sfdc.username=test.user@mycompany.com
sfdc.password=3b4c681773206eae857c4379730f9ddeb5c156a9a6b6fc2d338335aaf9c11b4bc2b15193613a5537
process.encryptionKeyFile=C:\\Program Files\\salesforce.com\\Apex Data Loader 21.0\\R4 Data Loader Integration\\Config\\EncryptionKey.key

 

 

Thanks in Advance

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
DSIDSI

Didn't work for me, but I eventually figured it out.  I needed to copy to sample log-conf file to the same directory as process-conf.  That's where the log4j parameter is set to "warn".

All Answers

glorialeek12glorialeek12

Did you ever get a resolution for this?  I am running into the exact same problem.  It worked with Apex Data Loader 17.0, but not with Apex 21.0.  I am also using Windows 7 now (not XP).  Any help would be appreciated.

mac_046mac_046

The problem was resolved.  I did a mistake.  I have mentioned the saleforce credentials in Config.Properties file and along with the credentials I have given the path to Encrypted key file too. I removed the encrypted key file path frrom the config.properties file and it worked for me.  This is because I have saved the encrypted key file and config,properties file in the same folder.

DSIDSI

Didn't work for me, but I eventually figured it out.  I needed to copy to sample log-conf file to the same directory as process-conf.  That's where the log4j parameter is set to "warn".

This was selected as the best answer