function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alliswellalliswell 

Data Loader Command Line error

Hi all,  

 

Following is my process-conf.xml file being used to define beans involved in upserting rows from csv to Salesforce.

 

 When I run the process file(through .bat file), I am getting an error saying:

org.xml.sax.SAXParseException: The element type "map" must be terminated by the matching end-tag "/map>"  

Which doesn't make sense to me because I have terminated map. Could this problem be deducted to some other cause?

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"

"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

<bean id="UsageUpsert" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false">

                <description>UsageInsert job gets the License and Usage record from the CSV file and upsert it into License and Usage custom object.</description>

                <property name="name" value="UsageUpsert"/>

                <property name="configOverrideMap">

                                <map>

                                                <entry key="sfdc.debugMessages" value="true"/></entry>

                                                <entry key="sfdc.debugMessagesFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\UsageInsertSoapTrace.log"/></entry>

                                                <entry key="sfdc.endpoint" value="https://test.salesforce.com"/></entry>

                                                <entry key="sfdc.username" value="username@salesforcedomain.com"/></entry>

                                                <entry key="sfdc.password" value="5-------------------------"/></entry>                                               

                                                <entry key="process.encryptionKeyFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\key.txt"/></entry>

                                                <entry key="sfdc.timeoutSecs" value="600"/></entry>

                                                <entry key="sfdc.loadBatchSize" value="200"/></entry>

                                                <entry key="sfdc.externalIdField" value="License_and_Sandbox_Usage_Statistics_ID__c"></entry>

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

                                                <entry key="process.operation" value="upsert"/></entry>

                                                <entry key="process.mappingFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\Mapping.sdl"/></entry>

                                                <entry key="dataAccess.name" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\TestDataSet.csv"/></entry>

                                                <entry key="dataAccess.type" value="csvRead"/></entry>

                                                <entry key="process.initialLastRunDate" value="2005-12-01T00:00:00.000-0800"/></entry>

                                                <entry key="process.statusOutputDirectory" value="C:\Program Files (x86)\salesforce.com\Data Loader\UsageUpsert"></entry>

                                               

                                </map>

                </property>

<p>        </p>

</property></bean><p>             </p>

</beans>

   

Best Answer chosen by Admin (Salesforce Developers) 
alliswellalliswell

Yeah I did it initially but then it showed me that <beans> is not closed. But I don't know what happened it worked when I removed <p></p>.

 

Thank you very much for your guidance GSBasso!!! Your previous posts helped me too :)

 

Now jumping into creating a Windows Scheduler task to run the batch file on monthly basis.....

 

In summary, following stuffs were done to complete successful upsert from command line.

 

-  Used parameters sfdc.proxypassword and sfdc.proxyUsername (should have realized this earlier...) in the process-conf.xml

- Removed </entry> and <p>  </p> from process-conf.xml [Thanks GSBasso :) ]

- Copied the entire salesforce.com/data loader from C:\Program Files (x86) to Desktop

- Commented out <!--entry key="process.encryptionKeyFile" value="C\:\\Program Files (x86)\\Salesforce.com\\Data Loader\\UsageUpsert\\key.txt"/--> from process-conf.xml

- Placed all six files in one folder: process-conf.xml, config.properties,key.txt,mapping.sdl, testdata.csv, run.bat

- Unzipped dataloader-27.0.1-uber jar file. Copied log4j.xml to the folder consisting of aforementioned six files and renamed it log-conf.xml

All Answers

GSBassoGSBasso

I suspect the issue is that your XML is not well-formed.

 

I've cleaned it up as follows:

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="UsageUpsert" class="com.salesforce.dataloader.process.ProcessRu?nner" singleton="false">
                <description>UsageInsert job gets the License and Usage record from the CSV file and upsert it into License and Usage custom object.</description>
                <property name="name" value="UsageUpsert"/>
                <property name="configOverrideMap">
                                <map>
                                                <entry key="sfdc.debugMessages" value="true"/>
                                                <entry key="sfdc.debugMessagesFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\UsageInsertSoapTrace.log"/>
                                                <entry key="sfdc.endpoint" value="https://test.salesforce.com"/>
                                                <entry key="sfdc.username" value="username@salesforcedomain.com"/>
                                                <entry key="sfdc.password" value="5-------------------------"/>
                                                <entry key="process.encryptionKeyFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\key.txt"/>
                                                <entry key="sfdc.timeoutSecs" value="600"/>
                                                <entry key="sfdc.loadBatchSize" value="200"/>
                                                <entry key="sfdc.externalIdField" value="License_and_Sandbox_Usage_Statistics_ID__c" />
                                                <entry key="sfdc.entity" value="License_and_Sandbox_Usage__c"/>
                                                <entry key="process.operation" value="upsert"/>
                                                <entry key="process.mappingFile" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\Mapping.sdl"/>
                                                <entry key="dataAccess.name" value="C:\Program Files (x86)\Salesforce.com\Data Loader\UsageUpsert\TestDataSet.csv"/>
                                                <entry key="dataAccess.type" value="csvRead"/>
                                                <entry key="process.initialLastRunDate" value="2005-12-01T00:00:00.000-0800"/>
                                                <entry key="process.statusOutputDirectory" value="C:\Program Files (x86)\salesforce.com\Data Loader\UsageUpsert" />
                                </map>
                </property>
<p></p>
</bean>
<p></p>
</beans>

 

alliswellalliswell

Thanks for your time @GsBasso!!

But I am still in need of ya'll's help!!

 

The following error shows up if the entry tag is not closed...

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 26 in XML document from file process-conf.xml is invalid; nested exception is org.xml.sax.SAXParseException: The element type "entry" must be terminated by the matching end-tag "</entry>"

So, I still used </entry> closing tags.

 

And here are the complete errors I am receiving constantly when I...

 

1. Using built-in logging configuration, no log-conf.xml in C:\Program Files (x86)\salesforce.com\Data Loader\bin\log-conf.xml

 

For this I have unzipped the dataloader.jar file to locate log4j.xml....however, I don't know what or how to edit this line..how can i change the path? Of which file? 

<param name="File" value="${java.io.tmpdir}/sdl.log" />

 

2.Error loading process: UsageUpsert configuration from config file: c:\program files (x86)\Salesforce.com\Data Loader\UsageUpsert\process-conf.xml

 

I do have config.properties, key.txt, mapping.sdl, testdata.csv, run.bat, and process-conf.xml ready. What else could be the problem?

 

 

3. org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 26 in XML document from file process-conf.xml is invalid; nested exception is org.xml.sax.SAXParseException: The element type "map" must be terminated by the matching end-tag "</map>"

 

Which doesn't make sense at all because I have terminated "map"

 

HELP!!!!!! 

 

Thanks!! :)

 

 

 

alliswellalliswell

Got pass the first error , two more to solve

1. Using built-in logging configuration, no log-conf.xml in C:\Program Files (x86)\salesfore.com\Data loader\bib\log-conf.xml

 

Extracted log4j from dataloader-27.0.1-uber.jar in data loader folder. Saved it as log-conf.xml in the bin directory.

 

 

 

GSBassoGSBasso
<entry/> is the same as <entry></entry> and both are well-formed.

<entry/></entry> is not well-formed.

Reviewing the corrected process-conf.xml I pasted into my previous reply I don't see any <entry> elements that are not well-formed.

The other thing you can do is open the file in a browser to check if it is well-formed. Most browsers (certainly IE) will tell you what is wrong if the XML is not well-formed.

 

Older installers of Data Loader used to include a log-conf.xml file but I've noticed that they've stopped doing this with more recent versions.

You can use the log4j.xml file from the jar as your template.

To override the default configuration file (i.e. the one in the jar) add the following to your Java command-line:

-Dlog4j.configuraiton=<path>/log-conf.xml

 

alliswellalliswell

Thanks GSBasso.

 

But now I have another same kind of error.

 

Element type "p" must be declared.

 

Along with, 

 

Error Loading Process

 

Failed to run process

GSBassoGSBasso

Get rid of all <p></p> lines. They are not needed.

alliswellalliswell

Yeah I did it initially but then it showed me that <beans> is not closed. But I don't know what happened it worked when I removed <p></p>.

 

Thank you very much for your guidance GSBasso!!! Your previous posts helped me too :)

 

Now jumping into creating a Windows Scheduler task to run the batch file on monthly basis.....

 

In summary, following stuffs were done to complete successful upsert from command line.

 

-  Used parameters sfdc.proxypassword and sfdc.proxyUsername (should have realized this earlier...) in the process-conf.xml

- Removed </entry> and <p>  </p> from process-conf.xml [Thanks GSBasso :) ]

- Copied the entire salesforce.com/data loader from C:\Program Files (x86) to Desktop

- Commented out <!--entry key="process.encryptionKeyFile" value="C\:\\Program Files (x86)\\Salesforce.com\\Data Loader\\UsageUpsert\\key.txt"/--> from process-conf.xml

- Placed all six files in one folder: process-conf.xml, config.properties,key.txt,mapping.sdl, testdata.csv, run.bat

- Unzipped dataloader-27.0.1-uber jar file. Copied log4j.xml to the folder consisting of aforementioned six files and renamed it log-conf.xml

This was selected as the best answer