I am working with an embedded Jetty server, deploying a Jersey REST api, and I am trying to log the errors, with log4J. When an error happens, for instance a URL not found,
You have a really old servlet-api jar present in your project.
javax.servlet.http.HttpServletResponse#getStatus() was added in Servlet 3.0
Add the following:
javax.servlet
javax.servlet-api
3.1.0
Dump your dependencies and verify that you don't have multiple versions of the servlet-api jars present (this is common, as the maven coordinate space for the servlet-api jars have changed a few times over the past 10 years)
$ mvn dependency:tree