[plt-scheme] Can't get PLT web-server to work with MrEd

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Sat Apr 8 15:57:42 EDT 2006

> Using the plt web-server, I would like for users to be able to upload an
> image file to the server, then I would resize the image to fit the
> required dimensions for the site. Now AFAIK, the only way I can process
> an image is using the bitmap% object which is available only with MrEd.
> The docs for the web-server state that "Servlets can use the full MrEd
> functionality" when started with the command "web-server". But when I do
> this, and try to make a button% object, I get reference to undefined
> identifier errors.
>
> Can anyone help me with what I'm doing wrong? I'm using PLT version 301.


Hi Eric,

Ok, I can duplicate your problem with module-based servlets.

Here's the sample servlet I'm testing, and the error message I see.  I
haven't investigated this yet, but hope that this will help others figure
out what's going on.  (I have go to lunch right now!  *grin*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(module test mzscheme
  (require (lib "mred.ss" "mred"))
  (provide interface-version timeout start)
  (define interface-version 'v1)
  (define timeout +inf.0)
  (define (start initial-request)
    (list #"text/plain"
          (format "~a" button%))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


I get a 500 with the following error:

---------------------------------------------------------------------------
Servlet didn't load.
dynamic-require: unknown module: #%mred-kernel

 === context ===
/export/home/dyoo/local/plt/collects/web-server/dispatch-servlets.ss:285:4:
lo
ad-servlet/path
/export/home/dyoo/local/plt/collects/web-server/dispatch-servlets.ss:268:4:
re
load-servlet-script
/export/home/dyoo/local/plt/collects/web-server/cache-table.ss:38:46
/export/home/dyoo/local/plt/collects/web-server/cache-table.ss:38:46
/export/home/dyoo/local/plt/collects/web-server/cache-table.ss:30:13
cache-table-lookup!
cache-table-lookup!
body
/export/home/dyoo/local/plt/collects/web-server/dispatch-servlets.ss:59:4:
ser
vlet-content-producer/path
/export/home/dyoo/local/plt/collects/web-server/dispatch-sequencer.ss:9:4:
loo
p
loop
loop
loop
/export/home/dyoo/local/plt/collects/web-server/web-server-unit.ss:105:8:
conn
ection-loop
/export/home/dyoo/local/plt/collects/web-server/web-server-unit.ss:93:
--------------------------------------------------------------------------



Posted on the users mailing list.