Thursday, October 15, 2009

Ant OutOfMemoryException

Currently where I work we use Ant to deploy our application to a Tomcat server. Recently, I integrated several new libraries for Apache's CXF web services and reran my ant script to do the deployment and encountered this:

deploy:
[echo] Deploying to 150.203.7.14:8080 ...

BUILD FAILED
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
at sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)

at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)


To resolve this I ended up setting the ANT_OPTS environment variable on my Windows machine as follows:

C:\workspace\PhenomeBank>set ANT_OPTS=-Xmx500m

No comments:

Post a Comment