当我尝试在调试模式下启动Jetty时

当我尝试在调试模式下启动Jetty时

本文介绍了当我尝试在调试模式下启动Jetty时,为什么将其挂起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,当我尝试以调试模式启动Start.java时,Jetty挂起.这是我的Start.java文件,摘自 Wicket快速入门页

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) {
.....
}

当我尝试访问 http://localhost:8080 时,我得到:

When I try to reach http://localhost:8080, I get:

问题访问/原因:

SERVICE_UNAVAILABLE

SERVICE_UNAVAILABLE

没有错误日志.怎么了,我该如何解决?

There are no error logs. What's wrong, and how do I fix it?

推荐答案

该问题可能是由您的IDEA调试选项引起的.在每个断点的断点部分,有一个suspend all/thread选项.如果您已在暂停的断点处停止,则所有线程Jetty都不会响应请求(因为它已被暂停).将断点更改为线程".

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".

这篇关于当我尝试在调试模式下启动Jetty时,为什么将其挂起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:50