【问题标题】:jHipster Undertow request failed HttpServerExchangejHipster Undertow 请求失败 HttpServerExchange
【发布时间】:2020-04-16 18:17:37
【问题描述】:

我正在将 jHipster 用于后端管理仪表板应用程序,我经常遇到此错误,每次出现时都会导致我的服务器停机。

2019-12-26 10:30:29,516 错误 [XNIO-2 task-10] WebsocketConfiguration$2:由于升级标头无效,握手失败:null 2019-12-26 10:38:46,039 错误 [XNIO-2 I/O-1] 请求:UT005071:Undertow 请求失败 HttpServerExchange{ CONNECT check.best-proxies.ru:80 请求 {Host=[check.best-proxies .ru:80]} 响应{}} java.lang.IllegalArgumentException: UT000068: Servlet 路径匹配失败 在 io.undertow.servlet.handlers.ServletPathMatchesData.getServletHandlerByPath(ServletPathMatchesData.java:83) 在 io.undertow.servlet.handlers.ServletPathMatches.getServletHandlerByPath(ServletPathMatches.java:88) 在 io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:151) 在 io.undertow.server.handlers.HttpContinueReadHandler.handleRequest(HttpContinueReadHandler.java:65) 在 io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:66) 在 io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) 在 io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:255) 在 io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136) 在 io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59) 在 org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) 在 org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) 在 org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88) 在 org.xnio.nio.WorkerThread.run(WorkerThread.java:561)

由于 jHipster 生成了很多配置,我唯一能找到的关于 undertow 的就是这个方法:

@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
    MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
    // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
    mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=utf-8");
    // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
    mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=utf-8");
    container.setMimeMappings(mappings);
    // When running in an IDE or with ./mvnw spring-boot:run, set location of the static web assets.
    setLocationForStaticAssets(container);

    /*
     * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288
     * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1.
     * See the JHipsterProperties class and your application-*.yml configuration files
     * for more information.
     */
    if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) &&
        container instanceof UndertowEmbeddedServletContainerFactory) {

        ((UndertowEmbeddedServletContainerFactory) container)
            .addBuilderCustomizers(builder ->
                builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
    }
}

谁能告诉我问题出在哪里?

提前致谢!

【问题讨论】:

  • 如错误提示,我宁愿看check.best-proxies.ru

标签: spring spring-boot http jhipster undertow


【解决方案1】:

是搜索爬虫获取url找不到,报错,可以在根目录下写robots.txt禁止。

【讨论】:

    猜你喜欢
    • 2018-03-03
    • 1970-01-01
    • 2018-10-12
    • 1970-01-01
    • 2019-07-14
    • 1970-01-01
    • 2017-04-02
    • 2014-01-31
    • 2020-11-26
    相关资源
    最近更新 更多