1

I am trying to use Force.com migration tool and trying to retrieve from an org.

I installed Ant,Java did specify credentials in my build properties as below

sf.username = **
sf.password =**
sf.serverurl = https://test.salesforce.com

sf.maxPoll = 20

When i try to do a retrieve i get this error

BUILD FAILED
C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample\build.xml:26: Failed to logi
n: Failed to send request to https://test.salesforce.com/services/Soap/u/32.0

when i do a ant -verbose i get below

C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample>ant -verbose
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
Trying the default build file: build.xml
Buildfile: C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample\build.xml
Detected Java version: 1.8 in: C:\Program Files\Java\jdk1.8.0_25\jre
Detected OS: Windows 8.1
parsing buildfile C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample\build.xml
with URI = file:/C:/Users/ABCD/Downloads/salesforce_ant_32.0/sample/build.xml
Project base dir set to: C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample
parsing buildfile jar:file:/C:/Users/ABCD/Desktop/apache-ant-1.9.4/lib/ant.jar!
/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Users/ABCD/Desktop/apa
che-ant-1.9.4/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
 [property] Loading C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample\build.pr
operties
 [property] Loading Environment env.
parsing buildfile jar:file:/C:/Users/ABCD/Desktop/apache-ant-1.9.4/lib/ant-sale
sforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/C:/Users/ABCD/Deskto
p/apache-ant-1.9.4/lib/ant-salesforce.jar!/com/salesforce/antlib.xml from a zip
file
parsing buildfile jar:file:/C:/Users/ABCD/Downloads/salesforce_ant_32.0/ant-sal
esforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/C:/Users/ABCD/Downl
oads/salesforce_ant_32.0/ant-salesforce.jar!/com/salesforce/antlib.xml from a zi
p file
Build sequence for target(s) `test' is [test]
Complete build sequence is [test, listMetadata, deployCode, deployCodeFailingTes
t, retrieveCode, deployCodeCheckOnly, retrieveUnpackaged, retrievePkg, bulkRetri
eve, describeMetadata, deployUnpackaged, undeployCode, deployZip, ]

test:
parsing buildfile jar:file:/C:/Users/ABCD/Desktop/apache-ant-1.9.4/lib/ant-sale
sforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/C:/Users/ABCD/Deskto
p/apache-ant-1.9.4/lib/ant-salesforce.jar!/com/salesforce/antlib.xml from a zip
file
[sf:deploy] Note: use ant -verbose to get more information on the failure

BUILD FAILED
C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample\build.xml:15: Failed to logi
n: Failed to send request to https://test.salesforce.com/services/Soap/u/32.0
        at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:218)
        at com.salesforce.ant.SFDCAntTask.getMetadataConnection(SFDCAntTask.java
:248)
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRun
ner.java:20)
        at com.salesforce.ant.DeployTask.execute(DeployTask.java:78)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: com.sforce.ws.ConnectionException: Failed to send request to https://
test.salesforce.com/services/Soap/u/32.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:121)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.jav
a:1266)
        at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:212)
        ... 20 more
Caused by: java.net.SocketException: Permission denied: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:79)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:345)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:188)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:649)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173
)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewH
ttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConn
ection.java:1146)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:997)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLC
onnection.java:1281)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCo
nnection.java:1256)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Htt
psURLConnectionImpl.java:250)
        at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.
java:136)
        at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTranspor
t.java:100)
        at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTranspor
t.java:95)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.jav
a:91)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        ... 22 more

Total time: 0 seconds

C:\Users\ABCD\Downloads\salesforce_ant_32.0\sample>

I dont have proxy or firewall enabled.But i do have windows 8.1 OS if that has got anything to do with this.

Anybody any clue?

  • Maybe you are missing the security token. Normally it will be provided by the property sf.securitytoken= at the build.properties. – Alexander Johannes Oct 29 '14 at 12:50
  • I give password+security token in the field sf.password field – sfdc99999 Oct 29 '14 at 12:54
  • Are you using an username for a Prod/DevOrg instead of a sandbox? sf.serverurl = https://test.salesforce.com expects a sandbox user. – Alexander Johannes Oct 29 '14 at 13:01
  • No.I dont really think this is a username/pwd issue as i cannot see a failed login in login history – sfdc99999 Oct 29 '14 at 13:02
  • Are you behind a firewall or on a vpn?. This type of error is caused by network problems. – PepeFloyd Oct 29 '14 at 13:15
2

See the article Why am I getting the error Failed to send request error?

This is usually caused by network problems, such as being blocked by a firewall of proxy settings missing in your configuration.

  • I can ping login.salesforce and get the response..so doesnt that mean i am not being blocked? – sfdc99999 Oct 29 '14 at 15:07
  • @sfdc99999 Being able to ping salesforce doesn't guarantee that there are no network problems. Make sure you configure the proxy if there is one. – PepeFloyd Oct 29 '14 at 22:04
0

Do you have proxy enabled ? I guess because of proxy you are able to ping from Command prompt but not from ANT. In case of Proxy server you need to specify in settings.

You can check this article - http://www.jitendrazaa.com/blog/salesforce/salesforce-migration-tool-ant/ or this may also help - http://www.jitendrazaa.com/blog/salesforce/automated-daily-backup-using-ant-migration-tool-and-git/

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.