Hello,

I've been trying for days to run a Jax-RS application in the following
environment :
- Tomcat 10.0.16
- Windows 11
- Eclipse 2021-12
and I finally found something weird.

I tried with two different implementations (RESTeasy and Jersey) and I get
the same behavior each time :
- when my implementation of jakarta.ws.rs.core.Application (say MyApp) is
inside war classes (WEB-INF/classes), my application isn't loaded.
- when my implementation of jakarta.ws.rs.core.Application (MyApp) is
inside a dependency (WEB-INF/lib), my application is properly loaded.

I used debug with RESTeasy and Jersey implementation : each time, their
implementation of jakarta.servlet.ServletContainerInitializer
(respectively org.jboss.resteasy.plugins.servlet.ResteasyServletInitializer
and org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer)
received MyApp in the 'classes' set of 'onStartup' method only when MyApp
is bundled into a dependency.

So far, the problem seems to relate to
the jakarta.servlet.ServletContainerInitializer implementation.

It is a change since servlet 3.0 spec. Is it intended by servlet 5.0 spec
or is it a bug in Tomcat 10.0.16 implementation ?

Reply via email to