Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant waits for user input

 
tovi sofer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Riffle Chris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you took a thread dump as was recommended. What did the thread dump tell you?
 
Tim Deborg
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic