You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/11/23 13:34:04 UTC

DO NOT REPLY [Bug 41024] New: - Problem with Input task

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41024

           Summary: Problem with Input task
           Product: Ant
           Version: 1.7.0RC1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: rmulvaney@curamsoftware.com


I am having a problem with the input task where it doesn't seem to validate the 
arguments being passed and just sits there awaiting input.
I have narrowed this down to a small test case that shows when a forked java 
process is called before the input task it does this...! Without the java task 
there or being forked it behaves fine.

The build.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project name="builds_scripts" default="compile">
  <target name="compile">
    <javac
      srcdir="C:/Temp"
      destdir="C:/Temp"
      includes="TestCase.java"
    />
    <java
      classname="TestCase"
      classpath="C:/Temp"
      fork="yes"
    >
    </java>
    <input
     message="Input?"
     validargs="y,n"
     addproperty="do.tag"
    />    
  </target>
</project>

The TestCase.java looks like:

public class TestCase{
  public static void main(final String[] arguments) {
    System.out.println("Testing");
  }
}

Cheers.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41024] - Problem with Input task

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41024





------- Additional Comments From stevel@apache.org  2006-11-23 05:00 -------
What's probably happening is that the input is being routed to the forked java
program, which is ignoring it. 

If you dont want this behaviour, add inputstring="" to the <java> task.

Now, the interesting question is why is this happening after the forked java
program has terminated. 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41024] - Problem with Input task

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41024





------- Additional Comments From rmulvaney@curamsoftware.com  2006-11-24 01:06 -------
I can confirm that works around the issue.
That said, we have a fairly large number of forked <java> tasks in our scripts 
and others not under our control that we import to make this change in.
How likely would it be to see a fix for this issue in the final release?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41024] - Problem with Input task

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41024





------- Additional Comments From richard.ward@jacobsrimell.com  2007-07-31 06:49 -------
I've encountered similar behaviour in version 1.6.5 and 1.7.0 (1.6.2 is ok). It
seems the input has to pass through the hierarchy of forked java calls before
the input is accepted. So 

    <target name="test-forked-inputs">
        <input>Not called java so assuming 1 return to continue.</input>
        <echo>Calling java </echo>
        <java classname="Hello" classpath="." fork="true"/>
        <echo>Calling java for the second time</echo>
        <java classname="Hello" classpath="." fork="true"/>
        <echo>Calling java for the third time</echo>
        <java classname="Hello" classpath="." fork="true"/>
        <echo>Calling java for the fourth time</echo>
        <java classname="Hello" classpath="." fork="true"/>
        <input>Called java 4 times since last input, so assuming 5 returns to
continue (4 for each forked java, plus 1 for the input).</input>
    </target>

requires the return key to be pressed once initially, then 5 times (as the
message says, 4 times for the number of forked java instances, plus one for the
input task itself). Doing either of a) removing the forked attribute or b)
setting inputstring="" in the java call gets around the problem.

IMHO the problem is as likely to be in the java task as in the input task. Ant
1.6.3 saw a fix to the java task [Programs run with <java fork="true"> can now
accept standard input from the Ant console. (Programs run with <java
fork="false"> could already do so.) Bugzilla 24918.]

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41024] - Problem with Input task

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41024


antoine@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.7.0RC1                    |1.7.0




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org