On 23/01/2022 08:13, Julien Bréda wrote:
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 ?

There is no specification change and I don't recall any changes in the relevant Tomcat code that could cause this.

The best thing to do is to open a Bugzilla issue and provide the source code for the simplest web application you can write that reproduces this. We can then build the WAR locally and do some debugging to see what is going on.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to