Hi guys,
in order to run my application on Tomcat with the REST API I extended the Spring Boot example from the Get Started guides (Get started with Camunda and the Spring Boot | docs.camunda.org) as follows:
- added dependency for REST starter
- changed packaging to WAR
- extended the SpringBootApplication class from SpringBootServletInitializer
When I execute the WAR everything works fine but when I deploy it on Tomcat the REST API is not working.
javax.servlet.ServletException: Servlet.init() for servlet org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause java.lang.IllegalStateException: The resource configuration is not modifiable in this context. org.glassfish.jersey.server.ResourceConfig$ImmutableState.register(ResourceConfig.java:274) org.glassfish.jersey.server.ResourceConfig$ImmutableState.register(ResourceConfig.java:221) org.glassfish.jersey.server.ResourceConfig.register(ResourceConfig.java:453) org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:387) org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)
Is that a known issue? Are there any workarounds?
Thanks and best regards
Thorsten