title: Ant: exec executable:error code 99
body: <p>We are building our app on Linux using Ant and compilation is fine and during deploy on websphere (deploy-build.xml)  we are using below code</p>
  
  <pre><code>&lt;exec executable="${shell.cmd}" failonerror="true"&gt;
              &lt;arg line="${wsadmin.cmd} -conntype ${wsadmin.conntype} -profileName ${was.profile} ${security.options} -lang jython -f ${scripts.dir}/app-server/jy/install-app.jy ${archive.location}"/&gt;
          &lt;/exec&gt;
  
  
          &lt;echo message="${app.name} (${archive.location} deployed." /&gt;
  </code></pre>
  
  <p>from logs we can see install-app.jy execution is successful. But still we are facing below error:</p>
  
  <pre><code>BUILD FAILED
  /home/EBbuild/env-build/b4b/env-build.xml:50: The following error occurred while executing this line:
  /home/EBbuild/env-build/deploy-build.xml:185: exec returned: 99
          at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
          at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
          at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
          at java.lang.reflect.Method.invoke(Method.java:613)
          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:357)
          at org.apache.tools.ant.Target.performTasks(Target.java:385)
          at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
          at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
          at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
          at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
          at org.apache.tools.ant.Main.runBuild(Main.java:758)
          at org.apache.tools.ant.Main.startAnt(Main.java:217)
          at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
          at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
  Caused by: /home/EBbuild/env-build/deploy-build.xml:185: exec returned: 99
          at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
          at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
          at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
          at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
          at java.lang.reflect.Method.invoke(Method.java:613)
          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:357)
          at org.apache.tools.ant.Target.performTasks(Target.java:385)
          at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
          at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
          at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
          at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
  </code></pre>
  
  <p>in above error message line 185 is exec code pasted above</p>
  
  <p>We are using bash shell (linux)</p>