Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

排除 Tomcat Jar 使用 Undertow 启动报错 #349

Closed
magestacks opened this issue Jul 22, 2022 · 0 comments · Fixed by #353
Closed

排除 Tomcat Jar 使用 Undertow 启动报错 #349

magestacks opened this issue Jul 22, 2022 · 0 comments · Fixed by #353
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@magestacks
Copy link
Member

Bug Report

在开始报告错误之前,请确保认真查看了以下步骤:

请在提交问题之前回答这些问题,谢谢。

你使用了哪个项目?Hippo-4J Server 还是 Hippo-4J Core?

同时存在。

你使用了哪个版本?

最新版本

预期行为

hippo4j-spring-boot-starter-example 启动成功

实际行为

启动失败

原因分析(如果可以)

WebAdapterAutoConfiguration @ConditionalOnClass({Servlet.class, Tomcat.class, UpgradeProtocol.class}) 引起

    /**
     * Refer to the Tomcat loading source code .
     * This load is performed if the {@link Tomcat} class exists and
     * the Web embedded server loads the {@link ServletWebServerFactory} top-level interface type at the same time
     */
    @Bean
    @ConditionalOnClass({Servlet.class, Tomcat.class, UpgradeProtocol.class})
    @ConditionalOnBean(value = ServletWebServerFactory.class, search = SearchStrategy.CURRENT)
    public TomcatWebThreadPoolHandler tomcatWebThreadPoolHandler(WebThreadPoolRunStateHandler webThreadPoolRunStateHandler) {
        return new TomcatWebThreadPoolHandler(webThreadPoolRunStateHandler);
    }

问题重现步骤

hippo4j-spring-boot-starter-example 参考如下配置改动:

        <!--<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
            <version>${tomcat-embed-core.version}</version>
        </dependency>-->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>

用于重现此问题的示例代码(例如 GitHub 链接)

@magestacks magestacks added the type: bug Something isn't working label Jul 22, 2022
@magestacks magestacks added this to the 1.3.2 milestone Jul 22, 2022
@pirme pirme linked a pull request Jul 22, 2022 that will close this issue
@pirme pirme closed this as completed Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants