aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant waits for user input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant waits for user input" Watch "ant waits for user input" New topic
Author

ant waits for user input

tovi sofer
Greenhorn

Joined: Jun 15, 2008
Posts: 10
Hi all,

I wrote a build.xml file which performs replacement in another file.
When I run it with ant it reaches to the marked line and stops running until <Enter> is pressed.
It also happens in another build file in replaceregexp task.

<target name=".." >
<record name="build.log" loglevel="debug" append="true"/>
<copy file="${..}" tofile="${...}" preservelastmodified="true" overwrite="true"/> <if>
<not>
<available file="{..web.descriptor.file}"/>
</not>
<then>
<touch file="${...generated.web.descriptor.file}"/>
</then>
</if>
<!-- Load the generated file into a property. -->
<loadfile property="...generated.descriptor.replace.local"
srcfile="...generated.web.descriptor.file}"/>
<!-- Create a load file of the depend component Web (if exists).. -->
<property name="...descriptor.replace.depend" value=""/>
<property name="..generated.descriptor.replace" value="${...generated.descriptor.replace.local} ${...generated.descriptor.replace.depend}"/>
<!-- Replace the special token in the target file with the generated code. -->
<replace file="${triv.facade.web.build.static.webinf.descriptor.file}"
token="${...descriptor.replacement.token}"
value="${....generated.descriptor.replace}"/>
</target>

I wrote debug meesages to verify these are the problematic lines.
The problem started after migrating to java-6 and ant 7.
Does anybody have an idea\suggestion what may be the cause for this?

thanks a lot.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

This doesn't sound right. I suspect that someone modified either Ant or one of it's libraries to wait for user input at some point, possibly as a debug mechanism. Run it again, and when the script pauses, take a thread dump - that will tell you where the the input request is located. If that does not help you, post the thread dump here.


JBoss In Action
Riffle Chris
Greenhorn

Joined: Feb 18, 2009
Posts: 27
I've noticed the same thing. I've wondered if it's in fact stopping OR just stopping the output to the console until <enter> is pressed.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I tried it with a simple example and the replace task does not hang on me. A thread dump would really help to get to the root cause of this...
Tim Deborg
Greenhorn

Joined: Aug 23, 2007
Posts: 6
Hallo,
I'm getting the exact same problem. Did anyone ever get a solution for this?
ant version was upgraded to 1.7.1, jdk 6.
Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I assume you took a thread dump as was recommended. What did the thread dump tell you?
Tim Deborg
Greenhorn

Joined: Aug 23, 2007
Posts: 6
Peter Johnson wrote:I assume you took a thread dump as was recommended. What did the thread dump tell you?

I'm not able to get the thread dump of that java process, jstack just hangs..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Try using a key combination (i.e., send a QUIT signal) to get the thread dump:
http://dev.day.com/content/kb/home/cq5/CQ5SystemAdministration/TakeThreadDump.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant waits for user input