Connecting to Jetty

Ashley Moran work at ashleymoran.me.uk
Tue May 23 12:02:40 UTC 2006


I know this isn't specifically related to the FreeBSD JDK but the SourceForge 
server won't let me join jetty-support.

I've installed the latest Jetty on FreeBSD 6.1/amd64 using the latest 1.5 JDK.  
With the default configuration, I can connect to 
http://localhost:8080/template/, but not http://127.0.0.1:8080/template/ or 
http://10.0.1.1:8080/template/ (the IP of the server).  As you can imagine, I 
can't connect at all remotely.

Here's the (presumably) relevant bit:
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Set name="Port">8080</Set>
        <Set name="PoolName">P1</Set>
        <Set name="MinThreads">20</Set>
        <Set name="MaxThreads">200</Set>
        <Set name="lowResources">50</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">2000</Set>
        <Set name="acceptQueueSize">0</Set>
        <Set name="ConfidentialPort">8443</Set>
        <Set name="IntegralPort">8443</Set>
      </New>
    </Arg>
  </Call>

If I add the following line to (naively) force it to bind to 10.0.1.1:
        <Set name="Host">10.0.1.1</Set>
then I get the error below (note I have made an rc script to run jetty 
through "su jetty -c ...", not that that should affect binding to a port > 
1024!)

I'm new to Jetty, and I am really eager to make it work but I can't for the 
life of me think why such a simple thing is failing.  Am i missing something 
really obvious?

Thanks
Ashley


> # /usr/local/etc/rc.d/jetty.sh start
> Defaulting JETTY_HOME to /usr/local/share/java/jetty
> Starting Jetty:
> STARTED Jetty Tue May 23 12:58:00 BST 2006
> Jetty running pid=22624
> May 23, 2006 12:58:00 PM org.mortbay.util.FileResource <clinit>
> INFO: Checking Resource aliases
> May 23, 2006 12:58:01 PM org.mortbay.http.HttpServer setStatsOn
> INFO: Statistics on = false for org.mortbay.jetty.Server at 766e3d60
> May 23, 2006 12:58:01 PM org.mortbay.http.HttpServer doStart
> INFO: Version Jetty/5.1.11RC0
> May 23, 2006 12:58:03 PM org.mortbay.util.Container start
> INFO: Started org.mortbay.jetty.servlet.WebApplicationHandler at 3b75078b
> May 23, 2006 12:58:03 PM org.mortbay.util.Container start
> INFO: Started WebApplicationContext[/template,Template WebApp]
> May 23, 2006 12:58:03 PM org.mortbay.jetty.servlet.WebApplicationContext
> resolveWebApp INFO: Extract
> jar:file:/usr/local/share/java/jetty/webapps/javadoc.war!/ to
> /var/tmp/Jetty_10_0_1_1_8080__javadoc/webapp May 23, 2006 12:58:04 PM
> org.mortbay.util.Container start
> INFO: Started org.mortbay.jetty.servlet.WebApplicationHandler at 3479e304
> May 23, 2006 12:58:04 PM org.mortbay.util.Container start
> INFO: Started WebApplicationContext[/javadoc,/javadoc]
> May 23, 2006 12:58:04 PM org.mortbay.util.ThreadedServer start
> WARNING: Failed to start: P1 at 10.0.1.1:8080
> May 23, 2006 12:58:04 PM org.mortbay.jetty.Server main
> WARNING: EXCEPTION
> org.mortbay.util.MultiException[java.net.BindException: Can't assign
> requested address] at
> org.mortbay.http.HttpServer.doStart(HttpServer.java:686) at
> org.mortbay.util.Container.start(Container.java:72)
>         at org.mortbay.jetty.Server.main(Server.java:460)
> java.net.BindException: Can't assign requested address
>         at java.net.PlainSocketImpl.socketBind(Native Method)
>         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
>         at java.net.ServerSocket.bind(ServerSocket.java:319)
>         at java.net.ServerSocket.<init>(ServerSocket.java:185)
>         at
> org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391) at
> org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477) at
> org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503) at
> org.mortbay.http.SocketListener.start(SocketListener.java:204) at
> org.mortbay.http.HttpServer.doStart(HttpServer.java:716) at
> org.mortbay.util.Container.start(Container.java:72)
>         at org.mortbay.jetty.Server.main(Server.java:460)

-- 
"If you do it the stupid way, you will have to do it again"
  - Gregory Chudnovsky


More information about the freebsd-java mailing list