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
Jerry_jJerry_j 

Errors using process.bat / Dataloader command line

I've created a conf xml file, done the encrypting of the password, and I'm ready to run process.bat 

However, when I run it using the command: "C:\users\JJ\AppData\Local\salesforce.com\Data Loader\samples\conf\" auto_account_process-conf

I get the following:
C:\Users\JJ\AppData\Local\salesforce.com\Data Loader\bin>process.bat "C:\Users\JJ\AppData\Local\salesforce.com\Data Loader\samples\conf\" auto_accoun
_process-conf
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc."
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 <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  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[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
C:\Users\JJ\AppData\Local\salesforce.com\Data Loader\bin>
 
Best Answer chosen by Jerry_j
3 Creeks3 Creeks
Take the last \ off of your path to the process-conf.xml file so that your command line looks like this:

process.bat "C:\Users\JJ\Documents\Salesforce Implementation\Oracle Data" noParentAccounts

All Answers

3 Creeks3 Creeks
Open your process.bat file and take a look at the -D option when the bat file is calling java.  It should look something like this:

-Dsalesforce.config.dir=%1

From your screen dump, it looks like the -D param in your bat file is wrong.
Jerry_jJerry_j
It matches what you have:

>more process.bat
@echo off
if not [%1]==[] goto run
echo.
echo Usage: process ^<configuration directory^> ^[process name^]
echo.
echo      configuration directory -- directory that contains configuration files,
echo          i.e. config.properties, process-conf.xml, database-conf.xml
echo.
echo      process name -- optional name of a batch process bean in process-conf.xml,
echo          for example:
echo.
echo              process ../myconfigdir AccountInsert
echo.
echo          If process name is not specified, the parameter values from config.properties
echo          will be used to run the process instead of process-conf.xml,
echo          for example:
echo.
echo              process ../myconfigdir
echo.

goto end

:run
set PROCESS_OPTION=
if not [%2]==[] set PROCESS_OPTION=process.name=%2


IF "%JAVA_HOME%" == "" (
    for /f "tokens=*" %%i in ('dataloader-36.0.0-java-home.exe') do (
        IF EXIST "%%i" (
            set JAVA_HOME=%%i
        ) ELSE (
            echo %%i
        )
    )
)

IF "%JAVA_HOME%" == "" (
    echo To run process.bat, set the JAVA_HOME environment variable to the directory where the Java Runtime Environment ^(JRE^) is installed.
) ELSE (
    IF NOT EXIST "%JAVA_HOME%" (
        echo We couldn't find the Java Runtime Environment ^(JRE^) in directory "%JAVA_HOME%". To run process.bat, set the JAVA_HOME environment variable to t
he directory where the JRE is installed.
    ) ELSE (
        "%JAVA_HOME%\bin\java" -cp ..\dataloader-36.0.0-uber.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION%
    )
)

:end

>
3 Creeks3 Creeks
The issue that you are having is not with Dataloader, it is with your Java environment.   Take a look at your system's envrionment variables and see if there is an environment variable called JAVA_TOOL_OPTIONS.   If so, I think that is causing the issue.   Try getting rid of that environment variable and see if that fixes the issue.    Be careful though because the env var JAVA_TOOL_OPTIONS does not get set with a basic java install, so some other install on your system likely created it.  If you get rid of it, that other install may not work anymore.
Jerry_jJerry_j
Ok, I've removed that env variable and rebooted. It still fails, but doesnt' give me that message:


C:\Program Files\salesforce.com\DataLoader\bin>process.bat "C:\Users\JJ\Documents\Salesforce Implementation\Oracle Data\" noParentAccounts
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 <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  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[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
C:\Program Files\salesforce.com\DataLoader\bin>
3 Creeks3 Creeks
Take the last \ off of your path to the process-conf.xml file so that your command line looks like this:

process.bat "C:\Users\JJ\Documents\Salesforce Implementation\Oracle Data" noParentAccounts
This was selected as the best answer
Jerry_jJerry_j
Thank you that did it!

Now I'm having password issues.

I first tried using ecnrypt.bat to encrypt my login password.

Got this:
2016-03-17 11:49:23,244 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process noParentAccounts
java.lang.RuntimeException: Invalid username, password, security token; or user locked out. Are you at a new location? When accessing Salesforce--either via a
 desktop client or the API--from outside of your companyÆs trusted networks, you must add a security token to your password to log in. To get your new securit
y token, log in to Salesforce. From your personal settings, enter Reset My Security Token in the Quick Find box, then select Reset My Security Token.

Then I reset my security token, and got it emailed to me.

I encrypted the security token, and got this:
2016-03-17 11:55:57,591 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process noParentAccounts
java.lang.RuntimeException: Invalid username, password, security token; or user locked out.


I tried entering the secuirty token directly (unencrypted) in the .xml file but got this:
2016-03-17 11:56:21,543 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process noParentAccounts
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadException: Error loading parameter: sfdc.password of type: java.lang.String


So....I'm closer (thanks for the help!) , but am on to the next problem.

Any ideas??


 
3 Creeks3 Creeks
It is not real clear from the documentation but when you encrypt the password, you are suppose to concatenate the password and secruity token together.  

The documentation says the command line should look like this:

encrypt.bat –e <password> "<filepath>\key.txt"

But it should really document it this way (in my opinion):

encrypt.bat –e <password><security token> "<filepath>\key.txt"

Try that.
Jerry_jJerry_j
That's it...success!

Thanks you so much for your help!
3 Creeks3 Creeks
Sure.  Can you mark this problem as solved?

Also, 3 Creeks has an app called DLRunner that is published on the AppExchange that may help you with your command line Data Loader.  The app provides more flexibility when scheduling data loader jobs, automates job status delivery, automates delivery of output files, and automates archiving.
Check it out and give it a try.  
Here is a direct link to the app on the appexchange: https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000qypQEAQ
Jerry_jJerry_j
will do, and i'll check it out.

thanks again
nari5a1nari5a1
Hi 3 creeks 

can you help me with this error pls

D:\salesforce.com\Data Loader\conf>loaddata
Processing AccountInsert
2019-06-14 11:25:25,688 INFO  [main] controller.Controller initLog (Controller.java:496) - Using built-in logging configuration, no log-conf.xml in C:\Users\nariy\AppData\Local\salesforce.com\Data Loader 43.0.0\conf\log-conf.xml
2019-06-14 11:25:25,688 INFO  [main] controller.Controller initLog (Controller.java:498) - The log has been initialized
2019-06-14 11:25:25,688 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:104) - Loading process configuration from config file: D:\salesforce.com\Data Loader\conf\process-conf.xml
2019-06-14 11:25:25,771 INFO  [main] support.AbstractApplicationContext prepareRefresh (AbstractApplicationContext.java:495) - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@18f9dd6: startup date [Fri Jun 14 11:25:25 EDT 2019]; root of context hierarchy
2019-06-14 11:25:25,811 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from file [D:\salesforce.com\Data Loader\conf\process-conf.xml]
2019-06-14 11:25:25,853 INFO  [main] support.DefaultListableBeanFactory preInstantiateSingletons (DefaultListableBeanFactory.java:557) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13fcdbd: defining beans [AccountInsert]; root of factory hierarchy
2019-06-14 11:25:25,887 INFO  [AccountInsert] controller.Controller createDir (Controller.java:289) - Config directory already exists: D:\salesforce.com\Data Loader\conf
2019-06-14 11:25:25,887 INFO  [AccountInsert] controller.Controller initConfig (Controller.java:417) - Looking for file in config path: D:\salesforce.com\Data Loader\conf\config.properties
2019-06-14 11:25:25,887 INFO  [AccountInsert] controller.Controller getInstalledConfigDir (Controller.java:379) - The installation configuration location is: D:\salesforce.com\Data Loader\conf
2019-06-14 11:25:25,887 INFO  [AccountInsert] controller.Controller initConfig (Controller.java:428) - User config file does not exist in 'D:\salesforce.com\Data Loader\conf\config.properties' Default config file is copied from 'D:\salesforce.com\Data Loader\conf\defaultConfig.properties'
2019-06-14 11:25:26,418 INFO  [AccountInsert] controller.Controller initConfig (Controller.java:460) - The controller config has been initialized
2019-06-14 11:25:26,420 INFO  [AccountInsert] process.ProcessRunner run (ProcessRunner.java:123) - Initializing process engine
2019-06-14 11:25:26,420 INFO  [AccountInsert] process.ProcessRunner run (ProcessRunner.java:126) - Loading parameters
2019-06-14 11:25:26,424 INFO  [AccountInsert] security.EncryptionAesUtil createUserProfileKeyName (EncryptionAesUtil.java:134) - C:\Users\nariy\.dataloader was created
2019-06-14 11:25:26,604 ERROR [AccountInsert] security.EncryptionAesUtil decryptMsg (EncryptionAesUtil.java:215) - Fail to decrypt message: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
2019-06-14 11:25:26,605 ERROR [AccountInsert] config.Config decryptProperty (Config.java:721) - Error loading parameter: sfdc.password of type: java.lang.String
java.security.GeneralSecurityException: Error to decrypt message:
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:216)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:715)
        at com.salesforce.dataloader.config.Config.decryptPasswordProperty(Config.java:677)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:666)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config.java:695)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:127)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:107)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:266)
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
        at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
        at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853)
        at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
        at javax.crypto.Cipher.doFinal(Cipher.java:2164)
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:239)
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:213)
        ... 7 more
2019-06-14 11:25:26,612 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:251) - Unable to run process AccountInsert
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadException: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:169)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:107)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:266)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:722)
        at com.salesforce.dataloader.config.Config.decryptPasswordProperty(Config.java:677)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:666)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config.java:695)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:127)
        ... 2 more
Caused by: java.security.GeneralSecurityException: Error to decrypt message:
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:216)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:715)
        ... 6 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
        at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
        at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853)
        at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
        at javax.crypto.Cipher.doFinal(Cipher.java:2164)
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:239)
        at com.salesforce.dataloader.security.EncryptionAesUtil.decryptMsg(EncryptionAesUtil.java:213)
        ... 7 more
3 Creeks3 Creeks
Hi nari5a1 -

The issues you are having is due to Datalaoder not being able to login to Salesforce.  More specifically, there is an issue with the encrypted password & security token combination.  Did you follow these directions https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/loader_encryption.htm and then configure the sfdc.password and process.encryptionKeyFile properties in your process conf file? 

The error that is showing is complaining about not being able to decrypt the password and the key file is used to do the decryption so maybe the key file specified for the process.encryptionKeyFile property is not correct?

 
nari5a1nari5a1
Hi 3 Creeks,

It worked Thanks a lot for your suggestion:)