Restlet Server不接受新连接

时间:2015-06-22 14:51:57

标签: java restlet-2.0

我正在使用Restlet来实现Web服务。从PHP客户端连续多次调用服务器,但在少量调用成功完成后,进一步调用挂起服务器,显示消息:

INFO: Worker service state: Full 
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.BaseHelper$1 rejectedExecution
INFO: Worker service tasks: 0 queued, 10 active, 16 completed, 26 scheduled.
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.BaseHelper$1 rejectedExecution
INFO: Worker service thread pool: 1 core size, 10 largest size, 10 maximum size, 10 current size
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.Controller run
INFO: Stop accepting new connections and transactions. Consider increasing the maximum number of threads.

请在下面找到restlet服务器组件代码库:

    final Component serverComponent = new Component();
    serverComponent.getServers().add(Protocol.HTTP, 8182);
    final Series<Parameter> parameters = serverComponent.getContext().getParameters();
    parameters.add("maxThreads", "150");
    parameters.add("minThreads", "10");
    parameters.add("lowThreads", "145");
    parameters.add("maxQueued", "20");
    parameters.add("maxTotalConnections", "10000");
    serverComponent.getDefaultHost().attach("/v1", new Appv1());
    try {
        serverComponent.start();
    } catch (final Exception e) {
        LOGGERS.error("Exception while starting the application: " + e.getMessage());
    }

有人知道我在设置中遗漏了哪些变化?

1 个答案:

答案 0 :(得分:0)

我建议你使用框架的jetty扩展,而不是内部连接器。 如果您想这样做,只需将org.restlet.ext.jetty.jar和org.eclipse.jetty.jar添加到您的类路径中。