kwo/mojaha — Issue #1: Error while trying to register handler with Mongrel2
Author: amarjeet
Created: 2012-02-08 09:07:30+00:00
State: open

Hi

I am trying to register the example listener mongrel2.examples.TestApp. I have not made any code changes whatsoever. I am able to execute the code and I can see the same on the java console:

```
Running. Ctrl-c to quit.
Started handler with sender id: 20ACBE50-DD9B-4704-9B98-F59DA590CD0E
Started handler with sender id: F87B7173-9072-4330-AE32-98A4EBBECE27
Started handler with sender id: AEE93C2D-863E-4ED6-9F2E-8FF30A2BAF04
```

In Mongrel2, this is the configuration that I am using:

```
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost", routes={
'/tests/': Dir(base='tests/', index_file='index.html', default_ctype='text/plain'),
'/java_handler/': Handler(
send_spec='tcp://localhost:44401',
send_ident='20ACBE50-DD9B-4704-9B98-F59DA590CD0E',
recv_spec='tcp://localhost:44402',
recv_ident='')
})
]
)

servers = [main]
```

There is a handler mapped to path '/java_handler'. When I reload the configuration, I see the following error on the Mongrel2 console:

```
[WARN] (src/handler.c:291: errno: Resource temporarily unavailable) Failed to bind send socket trying again for: tcp://localhost:44401
[WARN] (src/handler.c:291: errno: Resource temporarily unavailable) Failed to bind send socket trying again for: tcp://localhost:44401
[ERROR] (src/handler.c:295: errno: No such device) Too many bind attempts for handler tcp://localhost:44401
[ERROR] (src/handler.c:96: errno: None) Failed to create handler socket.
[ERROR] (src/handler.c:214: errno: None) Failed to initialize handler, exiting.
[ERROR] (src/handler.c:250: errno: None) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! HANDLER TASK DIED
```

I am not sure as to what else should I be doing in order to debug the problem. Any help would be highly appreciated.

Regards