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
MVJMVJ 

Deploying APEX Code

I am trying to deploy APEX code using the process outlined by SFDC.  I keep getting a login faluire.  I am behind a fire wall and will all other programs I need to make sure that I supply a proxy.  However, I do not see any instructions for deploying from behind a firewall.
 
Are there any better instructions for deploying code from your DEV or SANDBOX to Production.
 
Thanks
 
Mike Viola
Ron HessRon Hess
Please file a bugreport, include as much information as possible that will help us debug the issue.


MVJMVJ

I have opened a ticket and am working with my support team.  It is deffinitley the proxy settings.  When I run the deploy on another workstation that is not behind the firewall it works just fine.

I will update the posting when I get more information

gjsgjs
If your network requires an HTTP proxy, follow the instructions in Ant Proxy Configuration.
MVJMVJ
Followed those directins and still not working.  Tried setting the ANT_OPTS with the proxy host and port and also tried using the -Dhttpproxy.Host and -Dhttpproxt.Port and it did not work.  I am totally lost.
gjsgjs
Out of desperation, have you tried:
 
<setproxy proxyHost="${proxy.host}" proxyPort="${proxy.port}"/>
jmcjmc
Hi,
 
I am also trying to follow the sample provided by salesforce, and came across the same issue.  The log from dos command line is as follows:
 
 
C:\salesforce_ant\sample>ant deploy
Buildfile: build.xml
deploy:
[sf:compileAndTest] compileAndTest on https://test.salesforce.com/services/Soap/
u/10.0, compiling 1 classes and 1 triggers, deleting 0 classes and 0 triggers
[sf:compileAndTest] note: use ant -verbose to get more information on the failure
BUILD FAILED
C:\salesforce_ant\sample\build.xml:9: Failed to login:Failed to send request to
https://test.salesforce.com/services/Soap/u/10.0
Total time: 23 seconds
C:\salesforce_ant\sample>
 

I tried to setting up environment variable ANT_OPTS, but still doesn't work...  Any help would be much appreciated!
 
Thank you,
Mei
MVJMVJ
Glad to see I am not the only one with the same issue.  I have tried evrything that support has asked and no luck.  As a fall back I will beploy from my personal network with no firewall issues.
Bill EidsonBill Eidson
Could you run with: ant -verbose, to get more information.
MVJMVJ
I did.  The error was that the logon failed becasue it could not reach SFDC (Firewall issue). 
jmcjmc
When I ran ant -verbose, I got the following.  It couldn't find antlib.xml...?

C:\salesforce_ant\sample>ant -verbose
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.6 in: c:\Progra~1\Java\jdk1.6.0_02\jre
Detected OS: Windows XP
parsing buildfile C:\salesforce_ant\sample\build.xml with URI = file:/C:/salesfo
rce_ant/sample/build.xml
Project base dir set to: C:\salesforce_ant\sample
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apach
e/tools/ant/antlib.xml. It could not be found.
 [property] Loading C:\salesforce_ant\sample\build.properties
 [property] Loading Environment env.
 [setproxy] Setting proxy to proxy:8080
BUILD SUCCESSFUL
Total time: 0 seconds

Thank you,

Mei


Bill EidsonBill Eidson
  Yes, there is an issue w/ the ant tasks & proxy settings;  I'll post back here once has been fixed.

Bill EidsonBill Eidson
Ok, the proxy configuration issue has been fixed, thanks for your patience.
Please re-download the .zip and re-copy the jar into ant/lib.
MVJMVJ

Pulled it down ran it again and NO SUCH LUCK:

 

D:\SFDC\APEX\sample>ant deploy -Dhttp.ProxyHost=Bastion2.us.dnb.com -Dhttp.ProxyPort=8080
Buildfile: build.xml

deploy:
[sf:compileAndTest] compileAndTest on https://WWW.salesforce.com for sandbox/services/Soap/u/10.0, c
ompiling 1 classes and 1 triggers, deleting 0 classes and 0 triggers
[sf:compileAndTest] note: use ant -verbose to get more information on the failure

BUILD FAILED
D:\SFDC\APEX\sample\build.xml:9: Failed to login:Failed to send request to https://WWW.salesforce.co
m for sandbox/services/Soap/u/10.0

Total time: 0 seconds
D:\SFDC\APEX\sample>ant deploy -Dhttp.ProxyHost=Bastion2.us.dnb.com -Dhttp.ProxyPort=8080 -verbose
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jre1.6.0_02
Detected OS: Windows 2000
parsing buildfile D:\SFDC\APEX\sample\build.xml with URI = file:/D:/SFDC/APEX/sample/build.xml
Project base dir set to: D:\SFDC\APEX\sample
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.x
ml. It could not be found.
 [property] Loading D:\SFDC\APEX\sample\build.properties
 [property] Loading Environment env.
Build sequence for target(s) `deploy' is [deploy]
Complete build sequence is [deploy, delete, ]

deploy:
parsing buildfile jar:file:/D:/SFDC/ANT/apache-ant-1.7.0/lib/ant-salesforce.jar!/com/salesforce/antl
ib.xml with URI = jar:file:/D:/SFDC/ANT/apache-ant-1.7.0/lib/ant-salesforce.jar!/com/salesforce/antl
ib.xml
[sf:compileAndTest] compileAndTest on https://WWW.salesforce.com for sandbox/services/Soap/u/10.0, c
ompiling 1 classes and 1 triggers, deleting 0 classes and 0 triggers
[sf:compileAndTest] note: use ant -verbose to get more information on the failure

BUILD FAILED
D:\SFDC\APEX\sample\build.xml:9: Failed to login:Failed to send request to https://WWW.salesforce.co
m for sandbox/services/Soap/u/10.0
        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:187)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: com.sforce.ws.ConnectionException: Failed to send request to https://WWW.salesforce.com f
or sandbox/services/Soap/u/10.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1193)
        at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:301)
        at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)
        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:120)
        ... 17 more
Caused by: java.net.UnknownHostException: WWW.salesforce.com for sandbox
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown So
urce)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:115)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:88)
        ... 21 more
--- Nested Exception ---
com.sforce.ws.ConnectionException: Failed to send request to https://WWW.salesforce.com for sandbox/
services/Soap/u/10.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1193)
        at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:301)
        at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)
        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:120)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.net.UnknownHostException: WWW.salesforce.com for sandbox
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown So
urce)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:115)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:88)
        ... 21 more

Total time: 1 second
D:\SFDC\APEX\sample>

Bill EidsonBill Eidson

It should now be logging to indicate that a proxy was specified & I don't see that in the log, so somehow the settings aren't being picked up.

  Can you try the setProxy task as described here, http://ant.apache.org/manual/proxy.html, since that's the simplest way...  If, doing that, you still don't see the log indicating a proxy is being used, double check that ant  is picking up the right .jar.

  If you still have problems, please contact me offline & we can troubleshoot this together.

  Thanks,

  - Bill


MVJMVJ
Ran it again using the -autoproxy setting, per the ant proxy link you sent, and same result.
 
jmcjmc
Thank you Bill for the new .zip.  It works now!
 
To set proxy, in build.xml, add:
<setproxy proxyHost="${proxy.host}" proxyPort="${proxy.port}"/>
 
In build.properties, add:
proxy.host = proxy 
proxy.port = 8080
 
 
MVJMVJ
Bill that did it thanks for all the help.
MyGodItsColdMyGodItsCold
Could you give me the URL to this download - I fear I have the old version.
Bill EidsonBill Eidson
The links are in the app under setup->Build->tools.
The ant URL is: http://www.salesforce.com/downloads/ApexTools/salesforce_ant.zip