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

[JSR 356] Multiple endpoints on one servlet but only the first endpoint works #2347

Open
buharov-alexander opened this issue Aug 3, 2018 · 0 comments

Comments

@buharov-alexander
Copy link

I use atmosphere 2.4.28 and tomcat 9.0.5
My servlet config:

<servlet>
    <servlet-name>MyServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    ...
    <init-param>
        <param-name>org.atmosphere.cpr.asyncSupport</param-name>
        <param-value>org.atmosphere.container.JSR356AsyncSupport</param-value>
    </init-param>
    <async-supported>true</async-supported>
</servlet>
<servlet-mapping>
    <servlet-name>MyServlet</servlet-name>
    <url-pattern>/api/*</url-pattern>
</servlet-mapping>

Also, I have multiple server endpoints associated with this servlet:
/v1, /v2, ...

I can establish the WebSocket connection with all endpoints but if I make a request - only one endpoint(v3) will work as expected. Other endpoints return 404 error.

Seems JSR356AsyncSupport creates endpoints for paths:
/api
/api/{path0}
/api/{path0}/{path1}
/api/{path0}/{path1}/{path2}
...
Then WsServerContainer from tomcat-websocket addes only one TemplatePathMatch for each endpoint and ignores others. So requests only to one endpoint (which was init first) can be resolved correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant