Closed dsharinov closed 3 months ago
@dsharinov Could you please provide a sample project to reproduce this on Github?
@liweinan https://github.com/dsharinov/resteasy-example That's a simple example that fails with the error when deployed on Tomcat but runs successfully as a Spring Boot application.
Caused by: java.lang.IllegalStateException: Failed to register 'servlet com.example.resteasy.ResteasyServlet' on the servlet context. Possibly already registered?
at org.springframework.boot.web.servlet.DynamicRegistrationBean.register(DynamicRegistrationBean.java:122)
at org.springframework.boot.web.servlet.RegistrationBean.onStartup(RegistrationBean.java:52)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:241)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:197)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162)
Just in case, here are my settings for Tomcat run configuration in IntelliJ:
@dsharinov Thanks for the example and detail explanations :D I'll check it.
Sorry I was working on some other tasks, I'll try to find time to check this during this week.
@dsharinov I deployed the project to Tomcat 11 and it seems it doesn't have problem:
The Tomcat version I used is:
@liweinan Thanks! That's good to know, unfortunately it's still an alpha version. I cannot tell customers to install it. Would it still be possible to ignore registration failures and see if it works on Tomcat 10?
@liweinan Thanks! That's good to know, unfortunately it's still an alpha version. I cannot tell customers to install it. Would it still be possible to ignore registration failures and see if it works on Tomcat 10?
I haven't tested it on Tomcat 10. I'll verify this.
@dsharinov I tested it on Tomcat 10 and the example also works:
The tomcat I used is:
I assume this issue is answered. Please reopen it if the problem exists.
When deploying application on Tomcat, I'm getting the following error:
Executable war file runs without any issues. If when debugging, I set
ignoreRegistrationFailure
to true inResteasyApplicationBuilder#build
the application is deployed successfully. I checked the code for Jersey, and it's also configured to ignore registration failures. I couldn't find an easy way to get ride of the error.