Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with setting up hunchentoot

34 views
Skip to first unread message

Kim Stebel

unread,
Apr 9, 2008, 12:46:24 PM4/9/08
to
Hello group,

I'm new to LISP and I'm trying to set up a basic "Hello World"-website
with Hunchentoot. I'm using SBCL on linux and installed hunchentoot
via asdf-install. Now i registered a file handler and startet the
server:
(require :hunchentoot)
(setq hunchentoot:*dispatch-table*
(list (hunchentoot:create-static-file-dispatcher-and-handler "/
htt" "/home/kim/httest.html")))
(defvar *ht-server* (hunchentoot:start-server :port 3456))
The problem: No page is displayed when I tell my browser to go to
"localhost:3456/htt". Telneting to port 3456 always results in the
connection being immediately closed without an error message.
I googled quite a lot and tried

(setq hunchentoot:*SHOW-LISP-ERRORS-P* t)
(setq hunchentoot:*SHOW-LISP-BACKTRACES-P* t)
(setq hunchentoot:*catch-errors-p* nil)

Now each time I try to connect to hunchentoot, I get the following
error message in the REPL:
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD
"hunchentoot-worker-4" {B2271F9}>:
The function (SETF HUNCHENTOOT::FLEXI-STREAM-BOUND) is undefined.

I'm pretty lost here, so I'd really appreciate any help.

vanekl

unread,
Apr 9, 2008, 1:22:15 PM4/9/08
to


instead of 'require', use:
(asdf:oos 'asdf:load-op 'hunchentoot)

This will try to load a bunch of external modules, probably fail, and then
tell you that it cannot find a component.
You'll need to install 'em. Go to Edi's site for the components he created,
and you can find the rest at http://www.cliki.net/

You can tell (most of) which components you will be needing by looking at
the .asd file and seeing everything that it depends on.

:depends-on (:chunga
:cl-base64
:cl-fad
:cl-ppcre
#-(or :lispworks :hunchentoot-no-ssl) :cl+ssl
:md5
:rfc2388
#+:sbcl :sb-bsd-sockets
#+:sbcl :sb-posix
#+:openmcl :acl-compat
:url-rewrite)


Kim Stebel

unread,
Apr 9, 2008, 1:54:25 PM4/9/08
to
> instead of 'require', use:
> (asdf:oos 'asdf:load-op 'hunchentoot)
>
> This will try to load a bunch of external modules, probably fail, and then
> tell you that it cannot find a component.
Thanks for your quick reply!
load-op only gives me a bunch of style warnings though:
* (asdf:oos 'asdf:load-op 'hunchentoot)

; loading system definition from /usr/lib/sbcl/site-systems/
hunchentoot.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM :HUNCHENTOOT {AFC98A1}> as HUNCHENTOOT
; loading system definition from /usr/share/common-lisp/systems/url-
rewrite.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM URL-REWRITE {B2E2101}> as URL-REWRITE
; loading system definition from /usr/share/common-lisp/systems/
rfc2388.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM :RFC2388 {AA14441}> as RFC2388
; loading system definition from /usr/share/common-lisp/systems/
md5.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM MD5 {ACF29F9}> as MD5
; loading system definition from /usr/share/common-lisp/systems/cl
+ssl.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM :CL+SSL {AFD78D9}> as CL+SSL
; loading system definition from
; /usr/share/common-lisp/systems/flexi-streams.asd into #<PACKAGE
"ASDF0">
; registering #<SYSTEM :FLEXI-STREAMS {B2E61F1}> as FLEXI-STREAMS
; registering #<SYSTEM :FLEXI-STREAMS-TEST {A924961}> as FLEXI-STREAMS-
TEST
; loading system definition from
; /usr/share/common-lisp/systems/trivial-gray-streams.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM :TRIVIAL-GRAY-STREAMS {AC34E01}> as TRIVIAL-
GRAY-STREAMS
; loading system definition from /usr/share/common-lisp/systems/
cffi.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM CFFI {AFB0DE9}> as CFFI
; loading system definition from /usr/share/common-lisp/systems/cl-
ppcre.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM :CL-PPCRE {B37BA69}> as CL-PPCRE
; loading system definition from /usr/lib/sbcl/site-systems/cl-fad.asd
into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM #:CL-FAD {AA2B5E9}> as CL-FAD
; loading system definition from /usr/share/common-lisp/systems/cl-
base64.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM CL-BASE64 {AD36E01}> as CL-BASE64
; registering #<SYSTEM CL-BASE64-TESTS {AFFEAB1}> as CL-BASE64-TESTS
; loading system definition from /usr/share/common-lisp/systems/
chunga.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM :CHUNGA {B343009}> as CHUNGA
STYLE-WARNING: implicitly creating new generic function CHECK-IF-OPEN
STYLE-WARNING: implicitly creating new generic function TRANSFORM-
OCTET
STYLE-WARNING:
implicitly creating new generic function MAKE-IN-MEMORY-INPUT-
STREAM
STYLE-WARNING:
implicitly creating new generic function GET-OUTPUT-STREAM-SEQUENCE
STYLE-WARNING:
implicitly creating new generic function OUTPUT-STREAM-SEQUENCE-
LENGTH
STYLE-WARNING: implicitly creating new generic function SET-CLASS
STYLE-WARNING: implicitly creating new generic function WRITE-BYTE*
STYLE-WARNING: implicitly creating new generic function READ-BYTE*
STYLE-WARNING: implicitly creating new generic function UNREAD-CHAR%
STYLE-WARNING: implicitly creating new generic function UNREAD-BYTE
STYLE-WARNING: implicitly creating new generic function PEEK-BYTE
STYLE-WARNING:
implicitly creating new generic function (SETF CHUNKED-STREAM-INPUT-
CHUNKING-P)
STYLE-WARNING:
implicitly creating new generic function CHUNKED-INPUT-AVAILABLE-P
STYLE-WARNING: implicitly creating new generic function FILL-BUFFER
STYLE-WARNING: implicitly creating new generic function WRITE-CHUNK
STYLE-WARNING: implicitly creating new generic function FLUSH-BUFFER
STYLE-WARNING:
implicitly creating new generic function (SETF CHUNKED-STREAM-
OUTPUT-CHUNKING-P)
STYLE-WARNING: implicitly creating new generic function STRINGIFY-
COOKIE
STYLE-WARNING: implicitly creating new generic function DISPATCH-
REQUEST
STYLE-WARNING: implicitly creating new generic function WRITE-HEADER-
LINE
NIL

John Thingstad

unread,
Apr 9, 2008, 1:59:38 PM4/9/08
to
På Wed, 09 Apr 2008 19:54:25 +0200, skrev Kim Stebel <kims...@gmx.de>:

>> instead of 'require', use:
>> (asdf:oos 'asdf:load-op 'hunchentoot)
>>
>> This will try to load a bunch of external modules, probably fail, and
>> then
>> tell you that it cannot find a component.
> Thanks for your quick reply!
> load-op only gives me a bunch of style warnings though:
> * (asdf:oos 'asdf:load-op 'hunchentoot)
>

Silly compiler. defgeneric is not required anymore.
I don't know why the compiler doesn't like Edi's style :)
Anyhow it should be safe to just ignore them.

--------------
John Thingstad

vanekl

unread,
Apr 9, 2008, 2:05:16 PM4/9/08
to


Now that you have loaded all the modules that hunchentoot needs
to serve a request, your program should work now, or at least be
able to find the flexi-streams method it was looking for. Try it.

I assumed that you hadn't installed all the required components, but
you have, you just didn't load them. Lisp doesn't know how to automatically
load things it cannot find, so it displays an error message and asks
for direction.

BTW, if you need to reload hunchentoot after loading it once, you
can force a reload (if necessary) by doing,
(asdf:oos 'asdf:load-op 'hunchentoot :force t)

Kim Stebel

unread,
Apr 9, 2008, 2:50:03 PM4/9/08
to
Thanks again for your time, but unfortunately the problem persists and
i get exactly the same error message. :(
Does it matter what version of sbcl i'm using? It's 1.0.6 from the
ubuntu repos.

Jens Teich

unread,
Apr 9, 2008, 2:55:47 PM4/9/08
to
Kim Stebel <kims...@gmx.de> writes:

> Does it matter what version of sbcl i'm using? It's 1.0.6 from the
> ubuntu repos.

It is easier to get hunchentoot running if you have a sbcl version which
provides thread support.

Jens

vanekl

unread,
Apr 9, 2008, 2:59:52 PM4/9/08
to

in sbcl's customize-target-features.lisp file:

(lambda (features)
(flet ((enable (x)
(pushnew x features))
(disable (x)
(setf features (remove x features))))
;; Threading support, available only on x86/x86-64 Linux, x86 Solaris
;; ;; and x86 Mac OS X (experimental).
(enable :sb-thread)))

vanekl

unread,
Apr 9, 2008, 3:06:29 PM4/9/08
to

and if you don't know whether your build supports threads, you
can ask sbcl to tell you (notice where it says sb-thread):

CL-USER[3]: *features*
(:CL-PPCRE IT.BESE.ARNESI.MOPP::HAVE-MOP :SB-BSD-SOCKETS-ADDRINFO
:SPLIT-SEQUENCE :ASDF :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST
:SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
:IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX :LARGEFILE :GENCGC
:STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
:COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
:STACK-ALLOCATABLE-CLOSURES :ALIEN-CALLBACKS :LINKAGE-TABLE
:OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
:OS-PROVIDES-SUSECONDS-T)

Kim Stebel

unread,
Apr 9, 2008, 3:10:48 PM4/9/08
to
On Apr 9, 8:55 pm, Jens Teich <spamt...@jensteich.de> wrote:

It tested that and it does support threads. Thx.

vanekl

unread,
Apr 9, 2008, 3:14:38 PM4/9/08
to

I would try closing down sbcl and restarting it, but
this time loading hunchentoot only with asdf. If that doesn't
work, then I'm out of ideas, since I don't run this app.

Jens Teich

unread,
Apr 9, 2008, 3:17:25 PM4/9/08
to
> It tested that and it does support threads. Thx.

Did you try to run hunchentoot-test?

http://weitz.de/hunchentoot/#example

Jens

Kim Stebel

unread,
Apr 9, 2008, 3:32:19 PM4/9/08
to

I restarted sbcl and tried my program again as well as the example.
Guess what? Same error message. :(( If nobody else has a clue to why
this happens, I'll install the latest SBCL from source tomorrow and
try with that.
Thx again.
Kim

Jens Teich

unread,
Apr 9, 2008, 3:39:14 PM4/9/08
to
Kim Stebel <kims...@gmx.de> writes:

Try to ask on the hunchentoot mailinglist too.

http://common-lisp.net/mailman/listinfo/tbnl-devel

Jens

Khookie

unread,
Apr 9, 2008, 10:13:34 PM4/9/08
to
On Apr 10, 5:39 am, Jens Teich <spamt...@jensteich.de> wrote:

Sorry to intrude - u know, i think someone should create a easy-to-
start package (win/mac/linux) that contains sbcl, hunchentoot, all
required components and some tutorials (write a weblog in 5 seconds,
or create a reddit clone in 2 minutes haha) to get started with web
deving in lisp. im sure it would take a seasoned developer a few
hours to get a prototype package out, and it would be a great help to
those who are starting out.

I had great pains downloading the components and figuring out how asdf
worked. I got it semi-working a few months ago and ended up giving up
because it always came up with warnings & errors.

Chris

evan

unread,
Apr 9, 2008, 11:56:18 PM4/9/08
to
On Apr 10, 11:13 am, Khookie <chris.k...@gmail.com> wrote:
> On Apr 10, 5:39 am, Jens Teich <spamt...@jensteich.de> wrote:
> > Sorry to intrude - u know, i think someone should create a easy-to-
> start package (win/mac/linux) that contains sbcl, hunchentoot, all
> required components and some tutorials (write a weblog in 5 seconds,
> or create a reddit clone in 2 minutes haha) to get started with web
> deving in lisp.

No tutorials included, but there are some useful start packages which
fit your description:

http://weitz.de/starter-pack/
http://common-lisp.net/project/clbuild/

Evan

Khookie

unread,
Apr 10, 2008, 12:39:59 AM4/10/08
to

oh thanks for that - i'll give it a go later on, and hopefully the
experience is better this time :-).

Chris

Alessio Stalla

unread,
Apr 10, 2008, 11:27:05 AM4/10/08
to
> [Snip]

> Now each time I try to connect to hunchentoot, I get the following
> error message in the REPL:
> debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD
> "hunchentoot-worker-4" {B2271F9}>:
> The function (SETF HUNCHENTOOT::FLEXI-STREAM-BOUND) is undefined.
>
> I'm pretty lost here, so I'd really appreciate any help.

Searching for FLEXI-STREAM-BOUND in the source code of the version of
Hunchentoot I have installed gives no results. Mine is probably older
(it's 0.9.0), since I installed it many months ago with Edi's
starter's pack and never updated (yes, I'm lazy).
Anyway, your version of Hunchentoot tries to call a function (SETF
FLEXI-STREAM-BOUND) which does not exist. Given the name, I'd expect
the function to actually be in the Flexi-streams library, on which
Hunchentoot depends. So there's probably an incompatibility between
the Hunchentoot and Flexi-streams you have installed. I think asdf-
install downloads the latest snapshots of the libraries, so
occasionally they might not be in sync. Try reinstalling hunchentoot
and its dependencies. Or, in certain Linux distributions Hunchentoot
and friends come already packaged in the distribution's native format
(I know this is true for Debian and Gentoo at least), and that should
guarantee you install compatible versions. If that doesn't work, the
best place for asking for help is the Hunchentoot mailing list.

HTH,
Alessio Stalla

vanekl

unread,
Apr 10, 2008, 11:35:23 AM4/10/08
to

FLEXI-STREAM-BOUND is included in ver 0.14.0 of flexi-streams.
Good call.

Kim Stebel

unread,
Apr 10, 2008, 12:18:35 PM4/10/08
to
Sorry for wasting your time, i should have pointed out earlier that
the problem is already solved. I posted this issue to TBNL-devel and
they told me that my version of the FLEXI-STREAM library was too old.
I used the one in the ubuntu repos. So i removed that one and let asdf-
install get the latest one. Pretty simple, once you know what's
wrong..;) I wish asdf-install did some version checking on
libraries...like maven...*ducks*
0 new messages