title: How to use Jersey with a newer version of jackson
body: <p>I am using Jersey (2.23.1) with <code>jersey-media-json-jackson</code>. But that is linked against Jackson 2.5.4. But I need to use Jackson 2.6.0 (or a newer version).</p>
  
  <p>How can I do this?</p>
  
  <p>I tried to set it in my pom.xml:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-module-jsonSchema&lt;/artifactId&gt;
          &lt;version&gt;2.6.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
          &lt;version&gt;2.6.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jaxrs-xml-provider&lt;/artifactId&gt;
          &lt;version&gt;2.6.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Then jackson 2.6.0 is used. (I have also tried newer versions.) </p>
  
  <p>But my rest application throws various <code>NoSuchMethodError</code> or <code>ClassNotFoundExceptions</code>, like:</p>
  
  <pre><code>org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase.&lt;init&gt;(Lcom/fasterxml/jackson/databind/cfg/MapperConfig;)
  </code></pre>
  
  <p>Is there any way to use Jersey 2.23.1 with Jackson 2.6.0 or newer? TIA!</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>Here is a full stack trace:</p>
  
  <pre><code>javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase.&lt;init&gt;(Lcom/fasterxml/jackson/databind/cfg/MapperConfig;)V
      at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
      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:812)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase.&lt;init&gt;(Lcom/fasterxml/jackson/databind/cfg/MapperConfig;)V
      at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:278)
      at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:260)
      at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:509)
      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)
      ... 22 common frames omitted
  Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase.&lt;init&gt;(Lcom/fasterxml/jackson/databind/cfg/MapperConfig;)V
      at com.fasterxml.jackson.jaxrs.xml.XMLEndpointConfig.&lt;init&gt;(XMLEndpointConfig.java:22)
      at com.fasterxml.jackson.jaxrs.xml.XMLEndpointConfig.forReading(XMLEndpointConfig.java:27)
      at com.fasterxml.jackson.jaxrs.xml.JacksonXMLProvider._configForReading(JacksonXMLProvider.java:137)
      at com.fasterxml.jackson.jaxrs.xml.JacksonXMLProvider._configForReading(JacksonXMLProvider.java:47)
      at com.fasterxml.jackson.jaxrs.base.ProviderBase._configForReading(ProviderBase.java:467)
      at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:775)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:256)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:235)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
      at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundReadFrom(MappableExceptionWrapperInterceptor.java:74)
      at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
      at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
      at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
      at org.glassfish.jersey.server.ContainerRequest.readEntity(ContainerRequest.java:271)
      at org.glassfish.jersey.server.internal.inject.EntityParamValueFactoryProvider$EntityValueFactory.provide(EntityParamValueFactoryProvider.java:96)
      at org.glassfish.jersey.server.spi.internal.ParamValueFactoryWithSource.provide(ParamValueFactoryWithSource.java:71)
      at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:94)
      at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(JavaResourceMethodDispatcherProvider.java:127)
      at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
      at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
      at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
      ... 31 common frames omitted
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>Here is how I enable jackson for jersey:</p>
  
  <pre><code>    register(JacksonFeature.class);
      register(JacksonXMLProvider.class);
  </code></pre>