[plt-scheme] Problem with get-bindings in cgi.ss using MzScheme, CGI, and Tomcat 5.5

From: Mike Spreitzer (mspreitz at us.ibm.com)
Date: Wed Oct 12 10:16:01 EDT 2005

Has anyone succeeded in using MzScheme to make a CGI script for Tomcat 
5.5?  I'm trying it on Windows XP.  I'm using DrScheme 209.  The following 
script works:

(require (lib "cgi.ss" "net"))
(generate-html-output "Hello again!" '("<H1>Hello</H1>" "Hello World 
again!"))

but the following script

(require (lib "cgi.ss" "net"))
(define bs (get-bindings))
(generate-html-output "Hello again!" '("<H1>Hello</H1>" "Hello World 
again!"))

fails, with the following logged in localhost.<date>.log:

Oct 12, 2005 2:31:05 AM org.apache.catalina.core.ApplicationContext log
INFO: test1: runCGI (stderr):open-input-string: expects argument of type 
<string>; given #f
Oct 12, 2005 2:31:05 AM org.apache.catalina.core.ApplicationContext log
INFO: test1: runCGI (stderr):
Oct 12, 2005 2:31:05 AM org.apache.catalina.core.ApplicationContext log
INFO: test1: runCGI: 2 lines received on stderr

Here is what my web.xml says about this servlet:

    <servlet>
      <servlet-name>test1</servlet-name>
      <description>
        Test1.
      </description>
 <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
      <init-param>
        <param-name>executable</param-name>
        <param-value>c:/Program Files/PLT/MzScheme -r</param-value>
      </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>6</param-value>
        </init-param>
        <init-param>
          <param-name>cgiPathPrefix</param-name>
          <param-value>WEB-INF\cgi-bin</param-value>
        </init-param>
      <init-param>
        <param-name>passShellEnvironment</param-name>
        <param-value>true</param-value>
      </init-param>
      <!-- Load this servlet at server startup time -->
      <load-on-startup>5</load-on-startup>
    </servlet>

    <servlet-mapping>
      <servlet-name>test1</servlet-name>
      <url-pattern>/test1/*</url-pattern>
    </servlet-mapping>

Thanks,
Mike


Posted on the users mailing list.