views:

2380

answers:

10

When I launch ant script from Eclipse 3.4.x it print output to console until certain stage. After that it often hangs (wait forever). Last lines that I see at the screen (console) - partial output from my obfuscator.

Under Eclipse 3.3.2 everything works fine (the same project, workspace, settings, JVM etc.).

Does anybody have the same issue? Any thoughts how to fix it?

A: 

One possible cause is that you are running out of memory

Also try to run ant with the -diagnostics option.

You can check your memory usage and your eclipse.ini.

Another classic culprit is a blocking access to a locked resource (like an access to a file already being used by another process): try to close a many applications you can and relaunch ant.

VonC
Thank you for the suggestion, but I already check that. It's not my case.
FoxyBOA
A: 

Did you check the known issues for Ant in the Eclipse 3.4 release notes?

Jeffrey Fredrick
A: 

You can run ant builds using Eclipse's debugger, which might help find out the issue.

alex
+1  A: 

Did you limit the memory your console can allocate? Menu "Window" -> Preferences -> Run/Debug -> Console.

Select "Limit console output" Set "Console buffer size (characters)" to 200000.

The effect you're seeing might be related to the garbage collection: The console used up too much RAM and GC is starting to eat all available CPU cycles to clean up.

Aaron Digulla
A: 

That happened to me a while ago. I needed to erase all External Tool Configurations (Menu Run->External Tools) related to Ant, set the default JRE to 1.6 and restart Eclipse. Then my tasks worked.

Morgaelyn
A: 

Looks like ant implementation in Eclipse 3.4.x is partially broken (relevant for both Eclipse 3.4 and 3.4.1). Couple days ago met OOM in Ant task (dbunit). Without Eclipse the ant task works fine (test for bot ant 1.6.5 and 1.7.0).

Will hope that 3.5 and 3.4.2 resolve that unpredictable behavior of ant implementation.

FoxyBOA
A: 

Looks like most ant issues were resolved under the Eclipse 3.4.2

FoxyBOA
+1  A: 

We had a similar problem, which we couldn't fix by upgrading to the latest Eclipse version. After some time we found out that it was caused by a task which wrote a special character (German Umlaut ü) to the console. After changing the char to "ue", everything worked fine.

I suppose that character somehow killed the "get characters from ant and write them to the console" thread in Eclipse. Ant continued to write characters to the communication pipe, finally filled it up and blocked forever.

+1  A: 

i was using Eclipse 3.4.2 and ant task was hanging, ant output was getting onto the console only to a certain level and after that nothing was working.

I looked on the last line on the console and found some issue related to UTF-8.

This is the message (warning: unmappable character for encoding UTF8).

Go to External Tool. select the ant task, click on "Common Tab", change the encoding from default(UTF-8) to ISO-8859-1.

Prabhat