Using Tomcat 7. For my Jersey servlets(resources) to be initialized, I had to include the dependency org.glassfish.jersey.bundles:jaxrs-ri, which worked great. The runtime now recognize my Application class annotated with ApplicationPath.
Using jaxrs-ri gave birth to a new problem though; DefaultServlet no longer works. For example, navigating to a url in a browser, say localhost:9090/project/page.html will not work with this dependency present.
Did some googling but was unable to find anything useful.
What have you got in your web.xml file?
Have you got servlet mappings for "*" in there that would interfere with the ones that have been disabled?
The example code in t he documentation does exactly that.
I you give it servlet mapping e.g. /rest/* and put all your rest resources under the /rest path (as an example) then it should no longer greedily grab every single request, and your standard handler will get a look in.
As a general rule, you should pretend that Tomcat's Default Servlet doesn't exist and that the default handling for URL resources is done by magic. If you start acting like there's a Tomcat Default Servlet in your webapp, you're likely to end up with a non-compliant J2EE webapp.
The only time it's ever save to use "/*" or "*" as a servlet mapping is if the webapp in question is strictly web services or it is prepared to manually implement the various functions that the Default Servlet would normally be handling such as copying images and CSS, constructing directory listings, synthesizing default "404" and "503" pages and so forth. Since the Default Servlet is an artifact of a particular version of a particulat J2EE/JEE server, attempting to usurp all its functions can be hazardous.
Sometimes the only way things ever got fixed is because people became uncomfortable.
permaculture is giving a gift to your future self. After reading this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss