问题
My problem is that when I try to launch Start.java in debug mode, Jetty hangs. Here is my Start.java file, taken from the Wicket quickstart page
Server server = new Server();
SocketConnector connector = new SocketConnector();
// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
.....
try {
System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
server.start();
System.in.read();
System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
// while (System.in.available() == 0) {
// Thread.sleep(5000);
// }
server.stop();
server.join();
} catch (Exception e) {
.....
}
When I try to reach http://localhost:8080, I get:
HTTP ERROR: 503
Problem accessing / Reason:
SERVICE_UNAVAILABLE
There are no error logs. What's wrong, and how do I fix it?
回答1:
I had the same problem, Wicket hung on startup. After activating the debug log in log4j, I found out it hangs while generating or read a random from the underlying OS.
Try this: http://docs.codehaus.org/display/JETTY/Connectors+slow+to+startup
回答2:
The problem probably caused by your IDEA debugging options. At the breakpoints section for each breakpoint there is a suspend all / thread option. If you have stopped at a breakpoint which suspended all threads Jetty will not answer requests (since it has been suspended). Change the breakpoint to "thread".
来源:https://stackoverflow.com/questions/4601745/why-is-jetty-hanging-when-i-try-to-start-it-in-debug-mode