Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Jetty/Troubleshooting"
(→Big Problems) |
(→Big Problems) |
||
Line 67: | Line 67: | ||
[...]The IANA suggests 49152 to 65535 as "dynamic and/or private ports.[...] | [...]The IANA suggests 49152 to 65535 as "dynamic and/or private ports.[...] | ||
+ | |||
[...]Many Linux kernels use 32768 to 61000.[...] | [...]Many Linux kernels use 32768 to 61000.[...] | ||
− | We've fixed the test's code to make it run successfully on MacOS. If it fails however on your MacOS you've to raise the port range by executing the following | + | We've fixed the test's code to make it run successfully on MacOS. If it fails however on your MacOS you've to raise the port range by executing the following two commands in a terminal: |
<pre> | <pre> |
Revision as of 15:41, 6 September 2011
Contents
Big Problems
Why isn't my application/servlet/content served?
If you are clicking a link to access the application, then make sure you have not got a relative URL problem. Remember that a link to foo/bar on a page at /myapp/page will go to /myapp/foo/bar. If you want it to go to /myapp/page/foo/bar then you must 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, then there was an exception while deploying the webapplication. Check the log for for details.
Jetty has locked up?
You can test if 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, the it is likely something has gone wrong with the JVM and/or operating system rather than Jetty itself.
If you can attach to the JVM with jconsole and/or jvisualvm, then look to see how many threads are allocated and what task they are doing. A frequent cause of such "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 if Jetty is completely locked up by trying some simple requests and seeing if they are get a response. Hitting http://thehost.com/favicon.ico or some other image directly is often a good way to see if jetty is still running. If it is, then try some simple requests within the application that will use minimal features (no authentication, no database etc.) and see if any of those requests work.
Finally telnet can be used as a fake HTTP client to see if connections are being accepted. If you telnet to the port (eg 80 or 8080) and you see a "Connected to www.example.com" message, then Jetty is still accepting connections. Then try typing a request like "OPTION * HTTP/1.0" and hit Enter twice to see if you get a HTTP response. eg
# telnet blogs.webtide.com 80 Trying 72.32.76.94... Connected to blogs.webtide.com. Escape character is '^]'. OPTION * HTTP/1.0 HTTP/1.1 503 Service Unavailable Cache-Control: must-revalidate,no-cache,no-store Content-Type: text/html;charset=ISO-8859-1 Content-Length: 1287 Server: Jetty(7.0.0.v20091005)
Check that the "Server" in the response field is Jetty (and not a load balancer etc.).
Doing tests like these will help narrow down exactly which component has "locked up". Getting a thread dump (with jstack or ctl-\ or jvisualvm) is also invaluable to diagnose what the threads are doing.
JSP support not configured?
If JSP is not correctly configured then each context started will produce an error message like:
INFO::NO JSP Support for /, did not find org.apache.jasper.servlet.JspServletA request to a JSP will generate a 500 response with the message "500 JSP support not configured"
Why does StressTest.java fail on MacOS?
Read the following wikipedia entry for details:
http://en.wikipedia.org/wiki/Ephemeral_port
[...]The IANA suggests 49152 to 65535 as "dynamic and/or private ports.[...]
[...]Many Linux kernels use 32768 to 61000.[...]
We've fixed the test's code to make it run successfully on MacOS. If it fails however on your MacOS you've to raise the port range by executing the following two commands in a terminal:
sudo sysctl -w net.inet.ip.portrange.first=32768 sudo sysctl -w net.inet.ip.portrange.hifirst=32768It seems like Apple raised the limits for MacOS 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?
Why do I get a "Save could not be completed" error in Eclipse whenever I try to save a file while Jetty is running?
<useFileMappedBuffer>
to false
in webdefault.xml.