We run in Websphere 9. I'm trying to get a Jersey based REST service going. Using Jersey 3.0.2. I should note that there's no Maven involved here, I had to get all dependencies the old fashioned way because my employer doesn't allow Maven (don't ask, it's a story). It starts up, but upon request, the request returns:
Error 404: javax.servlet.UnavailableException: SRVE0201E: Servlet [org.glassfish.jersey.servlet.ServletContainer]: not a servlet class
No errors in the log. The web.xml is:
<servlet> <servlet-name>CCFService</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>pkg.ccf.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CCFService</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> The service pojo:
@Path("/review") public class Review { @GET @Path("/list") @Produces(MediaType.APPLICATION_JSON) public Map<String, Object> list() { //omitted because it's irrelevant, control never gets here } } The url I'm hitting (though I've tried variations):
http://localhost:9080/CCFPortal/review/list
I looked and that ServletContainer extends jakarta's servlet, not the HttpServlet. But I see examples all over the internet declaring the ServletContainer that way to enable the annotation scan in their package and subpackages.