0

I have ant setup running on my system from long time, Suddenly when i tried to run deployment commands in my system all were failing with below error message.

 deployCode:
    [sf:deploy] Note: use ant -verbose to get more information on the failure

    BUILD FAILED
    C:\Users\userName\Desktop\salesforce_ant_41.0\sample\build.xml:60: Failed to login: Failed to send request to https://test.salesforce.com/services/Soap/u/41.0

When i run the ant -verbose command below trace got shown in the command prompt.But couldn't find the exact reason for the failure of this command.

Total time: 1 second

C:\Users\userName\Desktop\salesforce_ant_41.0\sample>ant -verbose
Apache Ant(TM) version 1.10.1 compiled on February 2 2017
Trying the default build file: build.xml
Buildfile: C:\Users\userName\Desktop\salesforce_ant_41.0\sample\build.xml
Detected Java version: 1.8 in: C:\Program Files\Java\jdk1.8.0_121\jre
Detected OS: Windows 10
parsing buildfile C:\Users\userName\Desktop\salesforce_ant_41.0\sample\build.xml with URI = file:/C:/Users/userName/Desktop/salesforce_ant_41.0/sample/build.xml
Project base dir set to: C:\Users\userName\Desktop\salesforce_ant_41.0\sample
parsing buildfile jar:file:/C:/Program%20Files/apache-ant-1.10.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/apache-ant-1.10.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
 [property] Loading C:\Users\userName\Desktop\salesforce_ant_41.0\sample\build.properties
 [property] Loading Environment env.
parsing buildfile jar:file:/C:/Users/userName/Desktop/salesforce_ant_41.0/ant-salesforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/C:/Users/userName/Desktop/salesforce_ant_41.0/ant-salesforce.jar!/com/salesforce/antlib.xml from a zip file
Build sequence for target(s) `test' is [test]
Complete build sequence is [test, deployCode, deployCodeNoTestLevelSpecified, deployUnpackaged, describeMetadata, undeployCode, quickDeploy, deployCodeFailingTest, retrieveCode, deployCodeCheckOnly, cancelDeploy, listMetadata, deployZip, retrievePkg, retrieveUnpackaged, bulkRetrieve, , deployCodeRunLocalTests]

test:
[antlib:com.salesforce] Could not load definitions from resource com/salesforce/antlib.xml. It could not be found.
[sf:deploy] Note: use ant -verbose to get more information on the failure

BUILD FAILED
C:\Users\userName\Desktop\salesforce_ant_41.0\sample\build.xml:23: Failed to login: Failed to send request to https://test.salesforce.com/services/Soap/u/41.0
        at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:237)
        at com.salesforce.ant.SFDCAntTask.getMetadataConnection(SFDCAntTask.java:266)
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:20)
        at com.salesforce.ant.DeployTask.execute(DeployTask.java:63)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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:1405)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
        at org.apache.tools.ant.Main.runBuild(Main.java:857)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
Caused by: com.sforce.ws.ConnectionException: Failed to send request to https://test.salesforce.com/services/Soap/u/41.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:121)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:829)
        at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:230)
        ... 20 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514)
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:961)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
        at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.java:136)
        at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:100)
        at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:95)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:91)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        ... 22 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
        at sun.security.validator.Validator.validate(Validator.java:260)
        at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
        ... 39 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
        ... 45 more

Total time: 1 second

I checked all possible options for the failure like wrong credentials,profile permissions etc., everything is good from salesforce instance side and same is working in other laptops in same network. Tried running same by connecting to different instances and from different network's which resulted in same issue.

To check the connectivity with security toke and password , tried pinging to the instance with same credential's using data loader which worked without any issue.

Apart from this is there any other cause which may result to fail the ant to connect with salesforce?

8
  • 1
    I had this issue once, where my company's firewall was blocking Ant migration tool to connect to Salesforce. I raised a request with the network team to allow the IP address of our team's computer to connect to Salesforce. This solved the issue. Any new team member who tries to connect , his IP address needed to be white listed to allow to connect. This was the case with me. I would suggest , talk to your network team for help. – SfdcBat Sep 26 '17 at 23:08
  • @SfdcBat Thanks a lot for the inputs, sure i will check with my network team on this. – abey Sep 27 '17 at 4:29
  • Did you resolve this issue? – SfdcBat Sep 28 '17 at 2:59
  • @SfdcBat yes, seems to be problem with my system settings, I have turned off Publisher certificate revocation and Server Certificate revocation options under Advanced Security settings in Internet explorer - this has solved the problem. – abey Sep 29 '17 at 4:34
  • Great! Glad you got it! – SfdcBat Sep 29 '17 at 4:35

Your Answer

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

Browse other questions tagged or ask your own question.