ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Deviney <JDevi...@TWIA.ORG>
Subject RE: java.io.IOException: CreateProcess ... error=193
Date Wed, 10 Mar 2004 20:40:58 GMT
Found the solution to my problem.

At some point while working on a custom VSS Task an empty file with filename
"ss" was created in the VSS..\win32 directory.  From that point on, when my
task would run it would attempt to execute the empty ss file instead of
ss.exe.  Naturally I would get an INVALID EXE FORMAT error code (193).

John Deviney
Texas Windstorm Insurance Association
5700 S. MoPac Exp., Building E, Suite 530
Austin, TX 78749
512.899.4940
MSN Messenger: johnhdeviney@hotmail.com
jdeviney@twia.org


-----Original Message-----
From: John Deviney [mailto:JDeviney@TWIA.ORG]
Sent: Tuesday, March 09, 2004 4:43 PM
To: 'user@ant.apache.org'
Subject: java.io.IOException: CreateProcess ... error=193


Does anyone have a possible solution to this problem?

I've read quite a few postings with this exception but error=2 instead of
193.  I'm aware that there have been issues with slashes when using
environment variables.  I tried forward slashes, back slashes, double or
single slashes as environment variables or hard coded strings.  Same
results.  I don't think slashes are the problem.

The syntax as outputed by ant runs fine outside of ant.  The syntax appears
correct.  The VSS executable as specified in the build runs fine.  The base
VSS task "vssget", runs fine as well.


My environment is the following:
=======================
1) Windows 2000
2) Ant 1.5.4
3) Sun jdk 1.3.1_09
4) A Custom VSS Task implementation (code pasted below)
5) Build target using custom task (build code pasted below)

Java Source:
==========
package org.twia.util;

import org.apache.tools.ant.taskdefs.optional.vss.MSVSSGET;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.BuildException;

public class AntVSSExtensions extends MSVSSGET
{

   public static final String FLAG_COMPARE_DATE_TIME = "-GCD";
   private boolean compareDateTime = false;

   /**
    * Executes the task.
    * <p>
    * Builds a command line to execute ss and then calls Exec's run method
    * to execute the command line.
    */
   public void execute() throws BuildException {

      System.out.println("AntVSSExtensions.execute() - begin.");

       Commandline commandLine = new Commandline();
       int result = 0;

       // first off, make sure that we've got a command and a vssdir ...
       if (getVsspath() == null) {
           String msg = "vsspath attribute must be set!";
           throw new BuildException(msg, location);
       }

       // now look for illegal combinations of things ...

       // build the command line from what we got the format is
       // ss Get VSS items [-G] [-H] [-I-] [-N] [-O] [-R] [-V] [-W] [-Y]
[-?]
       // as specified in the SS.EXE help
       commandLine.setExecutable(getSSCommand());
       commandLine.createArgument().setValue(COMMAND_GET);

       // VSS items
       commandLine.createArgument().setValue(getVsspath());
       // -GL
       getLocalpathCommand(commandLine);

       // -GCD
       getCompareDateTimeCommand(commandLine);

       // -I- or -I-Y or -I-N
       getAutoresponse(commandLine);
       // -O-
       // getQuietCommand(commandLine);

       // -R
       getRecursiveCommand(commandLine);
       // -V
       getVersionCommand(commandLine);
       // -W
       getWritableCommand(commandLine);
       // -Y
       getLoginCommand(commandLine);

      System.out.println("AntVSSExtensions.execute() - just before run().");

      try {
         result = run(commandLine);
      }
      catch (BuildException be) {
         be.printStackTrace();
         throw be;
      }

      System.out.println("AntVSSExtensions.execute() - run result code = " +
result);
      System.out.println("AntVSSExtensions.execute() - end.");

       if (result != 0) {
           String msg = "Failed executing: " + commandLine.toString();
           throw new BuildException(msg, location);
       }
   }

   /**
    * Extract files using a date/time comparison; optional, default false.
    */
   public final void setCompareDateTime(boolean compareDateTime) {
       this.compareDateTime = compareDateTime;
   }

   /**
    * Make the 'compare date time' command if the attribute was 'true',
otherwise an empty string
    */
   public void getCompareDateTimeCommand(Commandline cmd) {
       if (!compareDateTime) {
           return;
       } else {
           cmd.createArgument().setValue(FLAG_COMPARE_DATE_TIME);
       }
   }
}


Build File Excerpts:
===============

    <taskdef name="twiavssget"
        classname="org.twia.util.AntVSSExtensions"
 
classpath="E:/WorkingDocuments/AntVSSExtractExtensions/antVSSExtensions.jar"
/>

   <!-- ===== TARGET: extract ==============================================
-->
   <target name="extract" if="ss.extract.enabled" 
      description="Clean build tree and extract everything from VSS.">
    <twiavssget
	localPath="E:/WorkingTBOT/CI"
        	compareDateTime="true"
        	recursive="true"
        	vsspath="/"
	ssdir="E:/Program Files/Microsoft Visual Studio/VSS/win32"
	serverPath="//Tomcat/VSS/TBOT/TBOT Development"
        	writable="true"/>
</target>


Output:
===============
E:\WorkingTBOT\DEV>ant extract
Buildfile: build.xml
extract:
[twiavssget] AntVSSExtensions.execute() - begin.
[twiavssget] AntVSSExtensions.execute() - just before run().
[twiavssget] file:E:/WorkingTBOT/DEV/build.xml:449: java.io.IOException:
CreateProcess: "E:\Program Files\Microsoft Visu
al Studio\VSS\win32\ss" Get $/ -GLE:\WorkingTBOT\CI -GCD -I- -R -W error=193
[twiavssget]    at
org.apache.tools.ant.taskdefs.optional.vss.MSVSS.run(MSVSS.java:195)
[twiavssget]    at
org.twia.util.AntVSSExtensions.execute(AntVSSExtensions.java:65)
[twiavssget]    at org.apache.tools.ant.Task.perform(Task.java:341)
[twiavssget]    at org.apache.tools.ant.Target.execute(Target.java:309)
[twiavssget]    at org.apache.tools.ant.Target.performTasks(Target.java:336)
[twiavssget]    at
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[twiavssget]    at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[twiavssget]    at org.apache.tools.ant.Main.runBuild(Main.java:609)
[twiavssget]    at org.apache.tools.ant.Main.start(Main.java:196)
[twiavssget]    at org.apache.tools.ant.Main.main(Main.java:235)
[twiavssget] --- Nested Exception ---
[twiavssget] java.io.IOException: CreateProcess: "E:\Program Files\Microsoft
Visual Studio\VSS\win32\ss" Get $/ -GLE:\Wo
rkingTBOT\CI -GCD -I- -R -W error=193
[twiavssget]    at java.lang.Win32Process.create(Native Method)
[twiavssget]    at java.lang.Win32Process.<init>(Win32Process.java:61)
[twiavssget]    at java.lang.Runtime.execInternal(Native Method)
[twiavssget]    at java.lang.Runtime.exec(Runtime.java:546)
[twiavssget]    at java.lang.reflect.Method.invoke(Native Method)
[twiavssget]    at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.jav
a:646)
[twiavssget]    at
org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:416)
[twiavssget]    at
org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:427)
[twiavssget]    at
org.apache.tools.ant.taskdefs.optional.vss.MSVSS.run(MSVSS.java:193)
[twiavssget]    at
org.twia.util.AntVSSExtensions.execute(AntVSSExtensions.java:65)
[twiavssget]    at org.apache.tools.ant.Task.perform(Task.java:341)
[twiavssget]    at org.apache.tools.ant.Target.execute(Target.java:309)
[twiavssget]    at org.apache.tools.ant.Target.performTasks(Target.java:336)
[twiavssget]    at
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[twiavssget]    at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[twiavssget]    at org.apache.tools.ant.Main.runBuild(Main.java:609)
[twiavssget]    at org.apache.tools.ant.Main.start(Main.java:196)
[twiavssget]    at org.apache.tools.ant.Main.main(Main.java:235)

BUILD FAILED
file:E:/WorkingTBOT/DEV/build.xml:449: java.io.IOException: CreateProcess:
"E:\Program Files\Microsoft Visual Studio\VSS
\win32\ss" Get $/ -GLE:\WorkingTBOT\CI -GCD -I- -R -W error=193

Any help is appreciated.

John Deviney
Texas Windstorm Insurance Association
5700 S. MoPac Exp., Building E, Suite 530
Austin, TX 78749
jdeviney@twia.org


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

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


Mime
View raw message