Big Problems

What about locked files on Windows?

Why isn't my application/servlet/content served?

To diagnose the problem:

If you think your application is running, but you get a 404 response, make sure that you have correctly set the context path.

If you click a link to access the application, make sure you don't have a relative URL problem. Remember that a link to foo/bar on a page at /myapp/page goes to /myapp/foo/bar. If you want it to go to /myapp/page/foo/bar, make sure the browser is redirected from /myapp/page to /myapp/page/.

If you still cannot get your content, look in the requestlog to see the exact URL that is being requested.

If you receive a 503 Unavailable response, an exception occurred while deploying the web application. Check the log for details.

Jetty has locked up?

If your requests are not getting any responses, a frequent description of the problem is that "Jetty locked up." To diagnose such problems, it is very important to work out exactly what has locked up.

You can test whether the JVM has locked up completely by trying to use a tool like Jconsole or jvisualvm to attach to the process.

If you cannot attach to the process, it is likely something has gone wrong with the JVM and/or the operating system rather than Jetty itself.

If you can attach to the JVM with Jconsole and/or jvisualvm, look to see how many threads are allocated and what tasks they are doing. A frequent cause of lockups is a slow database so that all the threads in the thread pool end up waiting for a JDBC connection from the connection pool.

You can test whether Jetty is completely locked up by trying some simple requests to see if they get a response. Opening http://thehost.com/favicon.icon or some other image directly is often a good way to see if Jetty is still running. If it is, try some simple requests within the application that use minimal features (no authentication, no database, for example) and see if any of those requests work.

Finally, you can use telnet as a fake HTTP client to see if Jetty is accepting connections. If you telnet to the port (80 or 8080) and you see a "Connected to www.example.com" message, Jetty is still accepting connections. Next try typing a request like "OPTION * HTTP/1.0" and press Enter twice to see if you get an HTTP response:

It seems that Apple raised the limits for Mac OS Lion, so on Lion it should work from scratch. If not, apply the sysctl commands and retry.

Logs and Warnings

Why do I get JVM Bugs reported?

Yes!
There are several NIO bugs in the JVM (especially for Linux) that are not fixed in the 1.6.x series. Jetty has implemented a number of JVM NIO Bug work arounds that keep a Jetty server working efficiently in the presence of these problems.

Why do I get a "Save could not be completed" error in Eclipse whenever I try to save a file while Jetty is running?

This is a limitation of Windows -- having a file open in one process means that you can't write to that same file with another process. Since Jetty has mapped the file to its cache, which prevents the file from being edited, you need to turn off caching to work around the problem. You can turn off caching in the default servlet by setting <useFileMappedBuffer> to false in webdefault.xml.