Created attachment 33160 [details] Ant Script which is failing inconsistently. I am using a Ant scripts which loads a xml files located at pre-defined paths into a Java Application (WEB N-Tier Architecture) using Application based API's. the ant scripts pick the xml files using loop tasks and then fire a command to load a file. The loading using ant scripts most of the time hang in between. Sometime it loads all the files. the ratio of success is 1 in every 3 attempts. I am attaching a load file along with this case.
The command I am using to execute the ant script is ant -f $WT_HOME/build_loader.xml -DsprintName=37 -Dwt.username=xxx -Dwt.password=xxx all JDK version is 1.7_51
Note that I have already tried inputstring="" in exec task.
Some additional information which may help. Almost all the time whenever the Ant build hangs while running (using EXEC) a command (java code) is after (ReportLoader.java) File dtdx20 = new File(WTProperties.getServerProperties().getProperty("wt.home") + windchillDirectorySeperator +"loadXMLFiles" + windchillDirectorySeperator+ "standardX20.dtd"); File copiedDtdx20 = new File(tempLocation+"standardX20.dtd"); FileUtils.copyFile(dtdx20, copiedDtdx20);
Correcting the last sentence in the description: I am attaching a build* file along with this case.
It looks like the problem is with third party code which uses FileUtils.copyFile(), but the failure occurs after copyFile() is called? in undisclosed code?
(In reply to Gintas Grigelionis from comment #5) > It looks like the problem is with third party code which uses > FileUtils.copyFile(), but the failure occurs after copyFile() is called? in > undisclosed code? Since this bug was opened ( 2015-10-04 ), the commons-IO which provides FileUtils.copyFile() had the following Release Notes that could maybe be linked to this issue. I assume that the user was using Commons IO 2.4 or earlier. Apache Commons IO Version 2.5 (https://commons.apache.org/proper/commons-io/upgradeto2_5.html) IO-385: FileUtils.doCopyFile can potentially loop for ever Exit loop if no data to copy Apache Commons IO 2.6 (https://commons.apache.org/proper/commons-io/upgradeto2_6.html) IO-502: Exceptions are suppressed incorrectly when copying files. Thanks to Christian Schulte. The user could change his application then the file copy would be done by ANT instead of the ReportLoader.java on which we have no way to debug (or at least outside of our scope). I think this bug could be closed.
Assuming Eugene is right, please reopen if problem still exists and seems to originate from ant, and not from the command called.