I found a bug in the Ant 1.5 on Windows 2003 expressing itself in ntvdm.exe exception: ************************************************************************ C:\WINDOWS\system32\ntvdm.exe Error while setting up environment for the application. Choose "Close" to terminate the application. ************************************************************************ It happens when we source the current environment variables from the environment, rather than properties file, starting with <property environment="env"/> Doing my research of the Ant 1.5 source code I established that while ant 1.5 correctly reports Windows 2003 as an operating system being run in a verbose mode, when it's coming to choosing the executable for the command line, it wrongly picks command.com instead of cmd.exe. I changed the logic of getProcEnvCommand() method in Execute.java to overcome this problem so that it will work with all systems it worked before, plus windows 2003. I'll describe the change to the source code in getProcEnvCommand() method in Execute.java of Ant 1.5: *************************************************************************** original code snippet with its author's comments (bug: the execution thread was testing "if" clause negatively and executing the code in "else" clause) *************************************************************************** ... else if (Os.isFamily("windows")) { // Determine if we're running under XP/2000/NT or 98/95 if (!Os.isFamily("win9x")) { // Windows XP/2000/NT String[] cmd = {"cmd", "/c", "set" }; return cmd; } else { // Windows 98/95 String[] cmd = {"command.com", "/c", "set" }; return cmd; } ... ****************************************************************************** new code snippet substituting the original one; the execution thread tests negatively the "if" clause and executes the "else" clause ****************************************************************************** //IR debuggged code }else if (Os.isFamily("windows")) { // Determine if we're running under XP/2000/NT/2003 or 98/95 if (Os.isFamily("win9x")) { // Windows 98/95 String[] cmd = {"command.com", "/c", "set" }; return cmd; } else { // Windows XP/2000/NT/2003 String[] cmd = {"cmd", "/c", "set" }; return cmd; } ************************************************************************** I didn't check the source code of other Ant versions. If they have the same snippet causing ntvdm.exe exception you may want to use my fix for them too. Regards, Irene. Irene Rusman. Sr. Software Engineer, BEA Systems. irusman@bea.com office: 408.570.8529
Fixed in CVS; thanks!
I just looked at the source code of Ant 1.6.1. It has the same snippet that will cause ntvdm.exe exception on Windows 2003. Please apply my fix for the versions Ant 1.5-1.6.1 and all the rest as needed. Irene. Irene Rusman Sr. Software Engineer, BEA Systems, irusman@bea.com
Re: "Please apply my fix for the versions Ant 1.5-1.6.1 and all the rest as needed." FYI Generally these only get fixed in CVS for the next release... Thanks, Matt
I am new to Apache but support an application that is using Ant 1.5 on Win2003. We are encountering this error. Where can I get this fix?
Diane, You need to get a later version of Ant, be it 1.6.5 or 1.7beta
(In reply to Matt Benson from comment #1) > Fixed in CVS; thanks! (In reply to Matt Benson from comment #3) > Re: "Please apply my fix for the versions Ant 1.5-1.6.1 and all the rest as > needed." > > FYI Generally these only get fixed in CVS for the next release... > > Thanks, > Matt test bugzilla
(In reply to Steve Loughran from comment #5) > Diane, > > You need to get a later version of Ant, be it 1.6.5 or 1.7beta hello test!