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
Robert Webber 12Robert Webber 12 

Can't Log in with SalesForce Migration Tool

I get invalid login,password or locked out when I try to run the ant migration tool. I have changed password and security token and still have the same problem. This used to work. Did something change?

Below is my buld.xml (with user name and password changed) followed by build.properties. Any idea how to fix or debug?
Thanks
Bob

Build.xml
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>

    <!-- Setting default value for username, password and session id properties to empty string
         so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
         will be treated literally.
    -->
    <condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
    <condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
    <condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>

    <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
        <classpath>
            <pathelement location="../ant-salesforce.jar" />            
        </classpath>
    </taskdef>

    <target name="getFalcon">
      <mkdir dir="Falcon"/>
      <sf:retrieve
          username="${sf.username}"
          password="${sf.password}"
          serverurl = "login.salesforce.com"
          retrieveTarget="Falcon"
          packageNames="Falcon1"/>
    </target>

Build.properties
# build.properties
#

# Specify the login credentials for the desired Salesforce organization
sf.username = username
sf.password = password
#sf.sessionId = <Insert your Salesforce session id here.  Use this or username/password above.  Cannot use both>
#sf.pkgName = <Insert comma separated package names to be retrieved>
#sf.zipFile = <Insert path of the zipfile to be retrieved>
#sf.metadataType = <Insert metadata type name for which listMetadata or bulkRetrieve operations are to be performed>

# Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
# Use 'https://test.salesforce.com for sandbox.
sf.serverurl = https://login.salesforce.com

sf.maxPoll = 20
# If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
#



 
VinayVinay (Salesforce Developers) 
Hi Robert,

This error is cause there was a recent update or reset of your Salesforce Security token or password,  can you check?

Thanks,
Robert Webber 6Robert Webber 6
Thanks. I have made sure that the security token is correct. I have changed passwords and updated the security token and I still have the same problem. I opened a case and they are working on it.
Robert Webber 6Robert Webber 6
Salesforce won't work on the case because it relates to the developer edition. I am really stuck here. I've tried everything. I commented out the lines in the build.properties file with # so I can focus on the build.xml file.  I get the error below:

Invalid username, password, security token; or user locked out.

I looked in the login history file and don't see the login attempt, although I can see my successful logins through the browser. Is there something wrong in my build.xml or is there something I need to do to enable a remote login? Really stuck here - can't test and modif my code in developer org in a sandbox. Really appreciate any help on this.

Below is what I currently have in my build.xml file.

<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>

    <!-- Setting default value for username, password and session id properties to empty string
         so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
         will be treated literally.
    -->
    <condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
    <condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
    <condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>

    <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
        <classpath>
            <pathelement location="../ant-salesforce.jar" />            
        </classpath>
    </taskdef>

    <target name="getFalcon">
      <mkdir dir="Falcon"/>
      <sf:retrieve
          username="username"
          password="passwordsecuritytoken"
          serverurl = "login.salesforce.com"
          retrieveTarget="Falcon"
          packageNames="Falcon1"/>
    </target>

 
NAG arjuna 10NAG arjuna 10
im having same trouble.its making  output folder but not able login in its showing (
Invalid username, password, security token; or user locked out.
)plz tell anyone need help