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

Jetty logs a warning about an empty context path when using WebFlux #17399

Closed
eungjun-yi opened this issue Jul 2, 2019 · 1 comment
Closed
Labels
type: bug A general bug
Milestone

Comments

@eungjun-yi
Copy link

eungjun-yi commented Jul 2, 2019

Jetty warns "Empty contextPath" while my server application, which depends on spring-boot-starter-webflux 2.1.6 and spring-boot-starter-jetty 2.1.6, is starting.

2019-07-02 19:00:40,472 WARN  main (ContextHandler) [-:-] Empty contextPath

It seems that JettyReactiveWebServerFactory sets the context path always to "".

ServletContextHandler contextHandler = new ServletContextHandler(server, "", false, false);

So it makes Jetty logs the warning message.

        if (contextPath.length() == 0)
        {
            LOG.warn("Empty contextPath");
            contextPath = "/";
        }

-- https://github.com/eclipse/jetty.project/blob/cf4e7412d440c581bc351de69fee1d00eac1a33e/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java#L1536-L1540

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 2, 2019
@eungjun-yi
Copy link
Author

eungjun-yi commented Jul 2, 2019

I think the context path should be null, "/" or an actual context path from server.sevlect.context-path property.

@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 2, 2019
@wilkinsona wilkinsona added this to the 2.1.x milestone Jul 2, 2019
@wilkinsona wilkinsona changed the title Jetty warns "Empty contextPath" Jetty logs a warning about an empty context path when using WebFlux Jul 2, 2019
@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.1.7 Jul 2, 2019
htztomic pushed a commit to htztomic/spring-boot that referenced this issue Jul 3, 2019
Previously, the context path was set to an empty string. The led to
Jetty logging a warning about an empty context path and then using
/ instead.

This commit avoids the warning while leaving the context path's end
result unchanged by setting the context path to /.

Closes spring-projectsgh-17399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants