0

I'm getting nowhere after following the exact steps and trying as much as i can. Can someone please help me why i'm getting this error? when i export, i am able tp run the job without having any issues and files are being placed at the location specified. But while i'm trying to do any other operation other than export, i'm getting this error. I'm using the same key i generated for export copying it to a different folder. The login credentials are same though

Build file

    <?xml version="1.0" encoding="UTF-8"?>
<project name="Export" default="all">
    <property file="build.properties"/>
    <property environment="env"/>
    <tstamp>
        <format property="todayDate" pattern="MM-dd-yyyy_HH-mm-ss" />
        <format property="todayDate_only" pattern="MM-dd-yyyy" />
    </tstamp>
    <macrodef name="export_AWSEC2">
        <attribute name="file"/>
        <attribute name="object"/>
        <attribute name="mappingFile"/>
        <attribute name="userName"/>
        <attribute name="password"/>
        <attribute name="serverURL"/>
        <attribute name="batchSize"/>
        <attribute name="limit"/> 

        <sequential>
            <mkdir dir="logs/${todayDate_only}"/>
            <copy file="template-process-conf.xml" tofile="process-conf.xml" overwrite="true" failonerror="true"/>
            <replace file="process-conf.xml">
                <replacefilter token="_object_" value="@{object}"/>
                <replacefilter token="_mappingFile_" value="@{mappingFile}"/>
                <replacefilter token="_file_" value="@{file}"/>
                <replacefilter token="_serverURL_" value="@{serverURL}"/>
                <replacefilter token="_userName_" value="@{username}"/>
                <replacefilter token="_password_" value="@{password}"/>
                <replacefilter token="_batchSize_" value="@{batchSize}"/>
                <replacefilter token="_logFile_" value="logs/${todayDate_only}/log.csv"/>
            </replace>
            <java classname="com.salesforce.dataloader.process.ProcessRunner" classpath="C:\Users\Radiant-rajendar\dataloader\v47.0.0\dataloader-47.0.0-uber.jar" failonerror="true">
                <sysproperty key="salesforce.config.dir" value="C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert"/>
                <arg line="process.name=@{object}"/>
            </java>
        </sequential>
    </macrodef>
    <target name="all">
        <export_AWSEC2
            file="C:\Users\Radiant-rajendar\Documents\AmazonEC2.csv"
            object="AWS_Pricing_EC2__C"
            mappingFile="EC2PricingMap.SDL"
            userName="${sf.prod.profileName.username}"
            password="${sf.prod.profileName.password}"
            serverURL="${sfSandbox.serverurl}"
            batchSize="200"
            limit = "1000" /> 
    </target>
</project>

Process-conf.xml

    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="_object_" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false">
    <description>TemplatedCsvExtract extracts to a CSV file."</description>
    <property name="name" value="TEST"/>
    <property name="configOverrideMap">
    <map>
        <entry key="process.encryptionKeyFile" value="keyfile"/>
        <entry key="sfdc.endpoint" value="https://ocean1--oceandsg1.my.salesforce.com"/>
        <entry key="sfdc.username" value="raj@radiantt.com.oceandsg1"/>
        <entry key="sfdc.password" value="*removed for the sake*"/>
        <entry key="sfdc.debugMessages" value="false"/>
        <entry key="sfdc.timeoutSecs" value="6000"/>
        <entry key="process.operation" value="insert"/>
        <entry key="dataAccess.type" value="csvRead"/>
        <entry key="sfdc.entity" value="AWS_Pricing_EC2__C"/>
        <entry key="process.mappingFile" value="EC2PricingMap.SDL"/>
        <entry key="dataAccess.name" value="C:\Users\Radiant-rajendar\Documents\AmazonEC2.csv"/>
        <entry key="sfdc.debugMessagesFile" value="logs/02-07-2020/log.csv"/>
    </map>
    </property>
    </bean>
</beans>

mappingFile:

#Mapping values
#Wed Feb 05 12:46:08 EST 2020
Memory=Memory__c
StorageMedia=StorageMedia__c
FromLocation=FromLocation__c
Currency=Currency__c
CurrentGeneration=CurrentGeneration__c
ToLocationType=ToLocationType__c
PreInstalledSW=PreInstalledSW__c
InstanceSku=InstanceSku__c
NetworkPerformance=NetworkPerformance__c
Group=Group__c
Instance=Instance__c
OfferingClass=OfferingClass__c
ProcessorArchitecture=ProcessorArchitecture__c
ServiceCode=ServiceCode__c
VCpu=VCpu__c
PricePerUnit=PricePerUnit__c
PurchaseOption=PurchaseOption__c
InstanceType=InstanceType__c
Provisioned=Provisioned__c

Error below:

    C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert>ANT all
Buildfile: C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\build.xml

all:
     [echo] Exporting AWS_Pricing_EC2__C
     [copy] Copying 1 file to C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert
     [java] 2020-02-07 12:39:22,080 INFO  [main] controller.Controller initLog (Controller.java:475) - Using built-in logging configuration, no log-conf.xml in C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\configs\log-conf.xml
     [java] 2020-02-07 12:39:22,195 INFO  [main] controller.Controller initLog (Controller.java:477) - The log has been initialized
     [java] 2020-02-07 12:39:22,213 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:104) - Loading process configuration from config file: C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\process-conf.xml
     [java] 2020-02-07 12:39:22,400 INFO  [main] support.AbstractApplicationContext prepareRefresh (AbstractApplicationContext.java:495) - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@44a59da3: startup date [Fri Feb 07 12:39:22 EST 2020]; root of context hierarchy
     [java] 2020-02-07 12:39:22,497 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from file [C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\process-conf.xml]
     [java] 2020-02-07 12:39:22,596 INFO  [main] support.DefaultListableBeanFactory preInstantiateSingletons (DefaultListableBeanFactory.java:557) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2a640157: defining beans [AWS_Pricing_EC2__C]; root of factory hierarchy
     [java] 2020-02-07 12:39:22,694 INFO  [TEST] controller.Controller createDir (Controller.java:306) - Config directory already exists: C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert
     [java] 2020-02-07 12:39:22,696 INFO  [TEST] controller.Controller initConfig (Controller.java:396) - Looking for file in config path: C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\config.properties
     [java] 2020-02-07 12:39:22,701 INFO  [TEST] controller.Controller initConfig (Controller.java:429) - User config is found in C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\config.properties
     [java] 2020-02-07 12:39:22,751 INFO  [TEST] controller.Controller initConfig (Controller.java:439) - The controller config has been initialized
     [java] 2020-02-07 12:39:22,754 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:123) - Initializing process engine
     [java] 2020-02-07 12:39:22,757 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:126) - Loading parameters
     [java] 2020-02-07 12:39:22,782 INFO  [TEST] config.LastRun load (LastRun.java:96) - Last run info will be saved in file: C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\TEST_lastRun.properties
     [java] 2020-02-07 12:39:22,830 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:134) - Logging in to: https://ocean1--oceandsg1.my.salesforce.com/
     [java] 2020-02-07 12:39:22,846 INFO  [TEST] client.PartnerClient login (PartnerClient.java:500) - Beginning Partner Salesforce login ....
     [java] 2020-02-07 12:39:22,894 INFO  [TEST] client.PartnerClient loginInternal (PartnerClient.java:544) - Salesforce login to https://ocean1--oceandsg1.my.salesforce.com//services/Soap/u/47.0 as user raj@radiantt.com.oceandsg1
     [java] 2020-02-07 12:39:23,742 INFO  [TEST] dao.DataAccessObjectFactory getDaoInstance (DataAccessObjectFactory.java:51) - Instantiating data access object: C:\Users\Radiant-rajendar\Documents\AmazonEC2.csv of type: csvRead
     [java] 2020-02-07 12:39:23,747 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:139) - Checking the data access object connection
     [java] 2020-02-07 12:39:23,752 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:144) - Setting field types
     [java] 2020-02-07 12:39:24,114 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:148) - Setting object reference types
     [java] 2020-02-07 12:39:25,262 INFO  [TEST] process.ProcessRunner run (ProcessRunner.java:152) - Creating Map
     **[java] 2020-02-07 12:39:25,477 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:251) - Unable to run process TEST**
     [java] java.lang.RuntimeException: java.lang.NullPointerException
     [java]     at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:169)
     [java]     at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:107)
     [java]     at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:266)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:218)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:155)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:861)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:231)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [java]     at java.base/java.util.Vector.forEach(Vector.java:1387)
     [java]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [java]     at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:449)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:830)
     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:223)
     [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
     [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
     [java] Caused by: java.lang.NullPointerException
     [java]     at java.base/java.lang.String$CaseInsensitiveComparator.compare(String.java:1224)
     [java]     at java.base/java.lang.String$CaseInsensitiveComparator.compare(String.java:1218)
     [java]     at java.base/java.util.TreeMap.compare(TreeMap.java:1292)
     [java]     at java.base/java.util.TreeMap.put(TreeMap.java:536)
     [java]     at java.base/java.util.TreeSet.add(TreeSet.java:255)
     [java]     at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:352)
     [java]     at java.base/java.util.TreeSet.addAll(TreeSet.java:312)
     [java]     at com.salesforce.dataloader.mapping.Mapper.<init>(Mapper.java:87)
     [java]     at com.salesforce.dataloader.mapping.LoadMapper.<init>(LoadMapper.java:54)
     [java]     at com.salesforce.dataloader.controller.Controller.createMapper(Controller.java:247)
     [java]     at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:153)
     [java]     ... 46 more

BUILD FAILED
C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\build.xml:58: The following error occurred while executing this line:
C:\Users\Radiant-rajendar\DataloaderCLI\Ocean-DSG1\Insert\build.xml:38: Java returned: -1

Total time: 4 seconds
2
  • Can you share all context information as well? E.g. how does the build.xml file look like, which operation are you trying, which input files are you specifying for the operation. Information in your question should ideally provide a self-explanatory example of what you're trying to achieve and the steps when you're experiencing an error. Feb 7, 2020 at 18:22
  • @MagnusKreth thanks for taking time to reply. I have updated the question with all the details probably will be helpful. all the build files are placed in a separate folder under My Documents
    – Raj
    Feb 7, 2020 at 18:42

1 Answer 1

-2

I figured the problem.

  1. I was using the key file copied from one folder to another folder and it was not authenticating it.

  2. My XML files did not has output file location specified which also conflicted the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.