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
claudioclaudio 

Problem Deploying Trigger Prodution Org

Hi,

I developed a Trigger and a test method using a sandbox org (the test method gave me 90% of code cover). After that I retrieved the trigger and test class using the ant tool. But when I  try to deploy to the "production org", I get the error:

BUILD FAILED
/home/claudio/deploy/sample/build.xml:25: Failures:

        at com.salesforce.ant.DeployTask.handleResponse(DeployTask.java:88)
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:107)
        at com.salesforce.ant.DeployTask.execute(DeployTask.java:37)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)
 
If I try to deploy to a "developer org" it works fine.

Any help?

Thanks,

Claudio
NadiaNadia
I have a similar problem. I am able to deploy back to dev environment, but when I try to deploy same classes and triggers to test environment, I get the exact same error. Can anyone help?

Thanks
Ron HessRon Hess
One possible reason is if your test methods use/assume data that exists in the dev org or sandbox, but which is not found in production environment.

test methods can construct data that they depend on to avoid this.
NadiaNadia
thanks for reply.
Actually I do not have any tests.
I still did not resolve this...
Ron HessRon Hess
you must have tests or you cannot deploy apex code
NadiaNadia
Ok I will write the tests then..however I do not understand why I am able to deploy back to the dev environment but not to test env. The tests are only required for non-dev environments?
thank you for replies.

Ron HessRon Hess
that sounds correct, test coverage is not a requirement for development in a dev org, only deploy to sandbox or production.
Bill EidsonBill Eidson
  The ant task has recently been updated to improve error messages in this (and other) cases.  If, after getting the latest drop from setup->develop->tools, you still get confusing error messages like this, don't hesitate to let me know.

  Thanks,

  - Bill

NadiaNadia
I got the sf ant jar from tool menu as you specified, so I suppose it is the latest version.
Bill EidsonBill Eidson
  It was updated just a few days ago.  The ant output from the original message was generated by an earlier version.

  Thanks,

  - Bill

NadiaNadia
ok I got the jar again, and now I get the same error however I also get a message that I have insufficient code coverage. So is still need to write the tests..
thanks for replies!
Bill EidsonBill Eidson
  Right --- the updated jar just improved the error message; the tests still need to be there.  Let me know if you have any other questions or issues getting it deployed.

  Thanks,

  - Bill

NadiaNadia
I wrote the test with 80% test coverage. Unfortunately I still cant deploy to sandbox... any ideas?

Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.6 in: C:\Java\jdk1.6.0\jre
Detected OS: Windows XP
parsing buildfile C:\Tasks\SCIP\SCIP_ant\build.xml with URI = file:/C:/Tasks/SCIP/SCIP_ant/build.xml
Project base dir set to: C:\Tasks\SCIP\SCIP_ant
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
 [property] Loading C:\Tasks\SCIP\SCIP_ant\build.properties
 [property] Loading Environment env.
Build sequence for target(s) `deploy' is [deploy]
Complete build sequence is [deploy, retrieve, ]

deploy:
parsing buildfile jar:file:/C:/Ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/C:/Ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml

BUILD FAILED
C:\Tasks\SCIP\SCIP_ant\build.xml:14: UNKNOWN_EXCEPTION msg: UNKNOWN_EXCEPTION: An unexpected error occured. Please include this ErrorId if you contact support: 1158347153-163
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:103)
        at com.salesforce.ant.DeployTask.execute(DeployTask.java:51)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)


Message Edited by Nadia on 03-07-2008 03:05 PM

Message Edited by Nadia on 03-07-2008 03:05 PM
Bill EidsonBill Eidson
  Nadia -

  This appears to have been an internal error that happened while one of your tests method was running.   I'll contact you offline to investigate this one.

  Thanks,

  - Bill