Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 5986 invoked from network); 5 Feb 2006 22:44:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Feb 2006 22:44:35 -0000 Received: (qmail 67479 invoked by uid 500); 5 Feb 2006 22:44:29 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 67424 invoked by uid 500); 5 Feb 2006 22:44:28 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 67413 invoked by uid 99); 5 Feb 2006 22:44:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Feb 2006 14:44:28 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of rhino1@sympatico.ca designates 209.226.175.74 as permitted sender) Received: from [209.226.175.74] (HELO tomts20-srv.bellnexxia.net) (209.226.175.74) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Feb 2006 14:44:27 -0800 Received: from athlon ([65.95.136.49]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060205224406.OEGQ8316.tomts20-srv.bellnexxia.net@athlon>; Sun, 5 Feb 2006 17:44:06 -0500 Received: from 127.0.0.1 (AVG SMTP 7.1.375 [267.15.2/251]); Sun, 05 Feb 2006 17:44:31 -0500 Message-ID: <003501c62aa5$ba4df740$0d02a8c0@athlon> From: "Rhino" To: "Ant Users List" , "Harshal Chavda" References: <20060205191011.19383.qmail@webmail31.rediffmail.com> Subject: Re: problem with exec task Date: Sun, 5 Feb 2006 17:44:30 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Harshal, "Error=2" from Windows means "file not found". You can find the full set of all of the Windows error codes at http://msdn.microsoft.com/library/?url=/library/en-us/debug/base/system_error_codes.asp?frame=true. You have either misspelled the name of the file or, more likely, you have failed to specify the correct path to the file. Double-check the spelling of both the "dir" and "executable" parameters to see if they are exactly correct. I see that your "dir" parameter is missing the drive letter, colon, backslash and maybe a directory level or two before 'tomcat4.1'; if you put the rest of the path there, you may find that your exec task works fine. Then again, maybe not. I just tried starting Tomcat on my computer via an Ant task that was written the same way as yours, only I put the full path in the 'dir' parameter; it didn't work and I got "error=2", just like you. So, if fixing the parameters along the lines I suggested don't work, choose one of the following two approaches: [Approach 1] [Approach 2] One of those two approaches should work for you. There may be other approaches that will work too. -- Rhino ----- Original Message ----- From: "Harshal Chavda" To: Sent: Sunday, February 05, 2006 2:10 PM Subject: problem with exec task HI to all fellow users, My configuration is jdk(1.3.1),Ant(1.6.3),tomcat(4.1) on a windows XP.I want to start the tomcat server(startup.bat).So I used the "exec" task.BUt I get an error which is follows : ==================================================================== prac.xml:82: Execute failed: java.io.IOException: CreateProcess: startup.bat error=2 at at ==================================================================== org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:620) at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExec utor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) at org.apache.tools.ant.Main.startAnt(Main.java:187) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) --- Nested Exception --- java.io.IOException: CreateProcess: startup.bat error=2 at java.lang.Win32Process.create(Native Method) at java.lang.Win32Process.(Win32Process.java:61) at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:546) at java.lang.reflect.Method.invoke(Native Method) at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execu te.java:834) at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:435) at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:449) at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:576) at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:617) at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExec utor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) at org.apache.tools.ant.Main.startAnt(Main.java:187) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) ===================================================================== The line 82 is--> . Can anyone please tell me how to find a solution for this Exception as I can only write very simple java programs and as such my knowledge of JAVA is limited. Thanks Harshal -------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 04/02/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 04/02/2006 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org