title: javax.servlet.http.HttpServletResponse.getStatus() not found
body: <p>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, and the console log shows the following error:</p>
  
  <pre><code>java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I
      at org.eclipse.jetty.server.handler.ErrorHandler.doError(ErrorHandler.java:142)
      at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:78)
      at org.eclipse.jetty.server.Response.sendError(Response.java:655)
      at org.glassfish.jersey.servlet.internal.ResponseWriter.callSendError(ResponseWriter.java:225)
      at org.glassfish.jersey.servlet.internal.ResponseWriter.commit(ResponseWriter.java:194)
      at org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:413)
      at org.glassfish.jersey.server.ServerRuntime$Responder.release(ServerRuntime.java:810)
      at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:515)
      at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334)
      at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
      at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
      at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
      at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
      at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
      at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      at org.eclipse.jetty.server.Server.handle(Server.java:564)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
      at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>There are my dependencies:</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;api-ejb&lt;/artifactId&gt;
              &lt;version&gt;${project.parent.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
              &lt;artifactId&gt;javax.ws.rs-api&lt;/artifactId&gt;
              &lt;version&gt;2.1-m09&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
              &lt;artifactId&gt;mongodb-driver&lt;/artifactId&gt;
              &lt;version&gt;3.2.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
              &lt;version&gt;1.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-multipart&lt;/artifactId&gt;
              &lt;version&gt;2.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.solr&lt;/groupId&gt;
              &lt;artifactId&gt;solr-solrj&lt;/artifactId&gt;
              &lt;version&gt;6.4.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-server&lt;/artifactId&gt;
              &lt;version&gt;9.4.6.v20170531&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-servlet&lt;/artifactId&gt;
              &lt;version&gt;9.4.6.v20170531&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
              &lt;version&gt;2.26-b02&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
              &lt;version&gt;2.26-b01&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>And the server initialization code:</p>
  
  <pre><code>ServletContextHandler servletContextHandler = new ServletContextHandler();
  ResourceConfig resourceConfig = new ResourceConfig();
  resourceConfig.register(MultiPartFeature.class);
  resourceConfig.register(GsonMessageBodyHandler.class);
  resourceConfig.register(PrivateAPI.class);
  resourceConfig.register(MalformedURLExceptionMapper.class);
  ServletContainer sc = new ServletContainer(resourceConfig);
  ServletHolder holder = new ServletHolder(sc);
  servletContextHandler.addServlet(holder, "/*");
  
  
  Server server = new Server(new InetSocketAddress(args[0], Integer.parseInt(args[1])));
  HandlerCollection handlerCollection = new HandlerCollection();
  
  handlerCollection.setHandlers(new Handler[] {servletContextHandler, new RequestLogHandler(), new DefaultHandler()});
  server.setHandler(handlerCollection);
  server.start();
  server.join();
  </code></pre>