CGIServlet

From: jürgen höller [werk3AT] <juergen.hoeller@xxx.at>
Date: Wed Sep 25 2002 - 07:09:13 PDT

Scott,

Resin's CGIServlet is unable to execute Perl scripts on my Windows 2000 machine. It repeatedly throws the following Exception:

java.io.IOException: CreateProcess: C:\projects\cbx\CMS\defaultroot\cgi-bin\helloworld.pl
error=193
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Win32Process.java:63)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:566)
        at java.lang.Runtime.exec(Runtime.java:491)
        at com.caucho.http.servlet.CGIServlet.service(CGIServlet.java:90)
        at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
        at com.caucho.server.http.Invocation.service(Invocation.java:312)
        at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
        at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
        at java.lang.Thread.run(Thread.java:536)

It does that not only with Perl scripts but with every custom file type. Only EXE and BAT files work, so custom file mappings seem to be the reason. The same behavior appears with a simple standalone class that executes the Perl script via Runtime.exec.

Tomcat 4.1.10's CGIServlet works correctly, so I've had a look at its sourcecode. They put "perl " in front of the first argument of Runtime.exec in case of ".pl" or ".cgi" files - obviously a workaround but it works.

Adding "perl " in the standalone test class works, so I've played with adding similar code to Resin's CGIServlet. Unfortunately that does not work there: Now I receive an Exception "error=123"...

What do you think? Do I miss something? I don't want to have to switch to Tomcat for that site...

Regards,
Juergen
Received on Wed 25 Sep 2002 07:09:13 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:16 PDT