# Ansible Tower: error running Apache Ant.exe command

**URL:** <https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 3, 2016, 2:58pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661 "2016-06-03T14:58:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffElep](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JeffElep](https://forum.ansible.com/u/JeffElep)\
**Post date:** [June 3, 2016, 2:58pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/1 "2016-06-03T14:58:15Z")

</div>

we are currently running Ansible Tower 2.1

target is Windows Server 2012 with SP2 \ running WinRM 3.0

in a playbook i have the following task

- name: string text togeter  
raw: cmd /c ant -buildfile deploy.xml stop-srvc1

i also tried:

- name: string text togeter  
raw: ant -buildfile deploy.xml stop-srvc1

Initially, the ant command was included in a PowerShell script and my playbook tasks looked like:

- name: string text togeter  
script: files/scripts/antScript.ps1

each run, we encountered the following error:  
Error: Could not create the Java Virtual Machine.  
Error: A fatal exception has occurred. Program will exit.  
with stderr:  
Error occurred during initialization of VM  
Unable to allocate 32768KB bitmaps for parallel garbage collection for the requested 1048576KB heap.

I have increased the value for WinRM’s MaxMemoryPerShellMB to 2048, which produced the same error. I later found that this property is being ignored by WinRM.

note: when “ant -buildfile deploy.xml stop-srvc1” is run locally at the Windows server, it is completed successfully.

please let me know if there is anything we can do at the Ansible side to reduce the amount of details being pushed to the target server along with the payload.

thanks

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [June 3, 2016, 3:49pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/2 "2016-06-03T15:49:01Z")

</div>

Tried the following hotfix?

[https://support.microsoft.com/en-us/kb/2842230](https://support.microsoft.com/en-us/kb/2842230)

---

<div class="post-metadata">

**Author:** ![JeffElep](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JeffElep](https://forum.ansible.com/u/JeffElep)\
**Post date:** [June 3, 2016, 5:40pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/3 "2016-06-03T17:40:29Z")

</div>

Thanks Matt,

i looked at the KB article and the download files available. They did not have a hotfix specific to Windows 2012 Server ☹

cheers!

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [June 4, 2016, 5:13am UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/4 "2016-06-04T05:13:54Z")

</div>

It’s the same hotfix for Windows 8 and Server 2012 (it’s in the fine print).

---

<div class="post-metadata">

**Author:** ![Bessie](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@Bessie](https://forum.ansible.com/u/Bessie)\
**Post date:** [June 4, 2016, 1:07pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/5 "2016-06-04T13:07:11Z")

</div>

Hi Jeff, Matt,

I am experiencing a similiar issue trying to execute a jvm based command with cmd over winrm using Ansible. Tried to apply the hotfix for Windows 8 on my Windows 2012 Server, but the hotfix simply said it is not applicable, so still no fix.

Any feedback would be appreciated.

---

<div class="post-metadata">

**Author:** ![JeffElep](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JeffElep](https://forum.ansible.com/u/JeffElep)\
**Post date:** [June 13, 2016, 1:06pm UTC](https://forum.ansible.com/t/ansible-tower-error-running-apache-ant-exe-command/21661/6 "2016-06-13T13:06:29Z")

</div>

Hi Matt,

I opened a ticket with Micorosoft, tech sent me a specific KB[2842230](https://support.microsoft.com/en-us/kb/2842230) bundle, from which i manually installed update-bf.mum (included in the .cab file) usign dism.exe.

steps were similar to what is documented in [http://social.technet.microsoft.com/wiki/contents/articles/3323.how-to-forcibly-install-the-ldr-branch-from-a-particular-hotfix-package.aspx](https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsocial.technet.microsoft.com%2fwiki%2fcontents%2farticles%2f3323.how-to-forcibly-install-the-ldr-branch-from-a-particular-hotfix-package.aspx&data=01%7c01%7cSDHIRAJ%40064d.mgd.microsoft.com%7c4661a90ecee24285932a08d3906b0cdc%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=lZYgGzkcgeqpCrFwzyUdVSTDPTN3YzyeqHH%2bBMz78aM%3d)
