+ Start a Discussion
MJ09MJ09 

Export data using Data Loader command line

I'd like to develop a batch file that can export data using the Data Loader command line. I'm starting with a simple process-conf.xml file:

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="account"
class="com.salesforce.lexiloader.process.ProcessRunner"
singleton="false">
<description></description>
<property name="name" value="csvAccount"/>
<property name="configOverrideMap">
<map>
<entry key="sfdc.endpoint" value="https://www.salesforce.com"/>
<entry key="sfdc.username" value="my_user_name"/>
<entry key="sfdc.password" value="my_80-char_password_string"/>

<entry key="sfdc.debugMessages" value="false"/>
<entry key="sfdc.debugMessagesFile" value="C:\Export.log" />
<entry key="sfdc.timeoutSecs" value="120"/>
<entry key="sfdc.loadBatchSize" value="200"/>

<entry key="process.operation" value="extract"/>
<entry key="dataAccess.type" value="csvWrite" />
<entry key="dataAccess.writeBatchSize" value="1" />
<entry key="sfdc.extractionRequestSize" value="1" />
<entry key="process.enableExtractSuccessOutput" value="true" />

<entry key="process.outputError" value="C:\ERRORaccount.csv" />

<entry key="dataAccess.name" value="C:\account.csv" />
<entry key="sfdc.entity" value="account"/>
<entry key="sfdc.extractionSOQL" value="select id, phone from account" />
</map>
</property>
</bean>
</beans>

 

When I run this from the command line, I get a bunch of DEBUG and INFO output, followed by:

 

2704 [account] INFO com.salesforce.lexiloader.dao.DataAccessObjectFactory - Instantiating data access object: C:\account.csv of type: csvWrite
2704 [account] INFO com.salesforce.lexiloader.process.ProcessRunner - Checkingthe data access object connection
2704 [account] INFO com.salesforce.lexiloader.process.ProcessRunner - Setting field types
3500 [account] INFO com.salesforce.lexiloader.process.ProcessRunner - Setting object reference types
Exception in thread "main" java.lang.NullPointerException
at com.salesforce.lexiloader.client.PartnerClient.setFieldReferenceDescribes(PartnerClient.java:462)
at com.salesforce.lexiloader.controller.Controller.setReferenceDescribes(Controller.java:140)
at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:129)
at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:228)

 

 It's logging in (if I change the username, I get a different error), and it creates the account.csv file, but it's empty.

 

If I change the sfdc.entity property to "xxx," I get an error indicating that no such SObject exists.

 

If I change the sfdc.extractionSOQL property to select from "xxx" instead of from "account," I get the same null pointer exception.

 

I'm logging in as a System Administrator, so I doubt there's a permission problem.

 

Any ideas?

 

Thanks,

 

MJ.

 

 

 

MJ09MJ09

Finally found at least one thing that was causing me problems -- the sfdc.entity value is case sensitive.

 

Don't use:

 

<entry key="sfdc.entity" value="account"/>

 

Use:

 

<entry key="sfdc.entity" value="Account"/>

 

Ankur201Ankur201

Its throwing an error, can you please suggest in this?

Error: Could not find or load main class com.salesforce.dataloader.process.Proce
ssRunner

MJ09MJ09
In the 9 years since I wrote my post, the Data Load has probably changed a bit. You'd do better to post a new question with more details for others to see and hopefully respond to.