title: Jersey REST API: java.lang.NoSuchMethodError: org.glassfish.jersey.message.filtering.EntityFilteringFeature.enabled
body: <p>in REST API using jersey, using Maven.
  Maven successfully added mox and entity jars.</p>
  
  <p>I'm getting below error when trying to get JSON type result.</p>
  
  <p>@Produces(MediaType.APPLICATION_JSON)</p>
  
  <p>content of pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;in.alonebirddev.acs&lt;/groupId&gt;
      &lt;artifactId&gt;messanger&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;messanger&lt;/name&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;messanger&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.jersey&lt;/groupId&gt;
                  &lt;artifactId&gt;jersey-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jersey.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&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;!-- use the following artifactId if you don't need servlet 2.x compatibility --&gt;
              &lt;!-- artifactId&gt;jersey-container-servlet&lt;/artifactId --&gt;
          &lt;/dependency&gt;
          &lt;!-- uncomment this to get JSON support    --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt;
              &lt;version&gt;2.23.2&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.ext&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-entity-filtering&lt;/artifactId&gt;
      &lt;version&gt;2.7&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;jersey.version&gt;2.23.2&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>error :</p>
  
  <pre><code>SEVERE: StandardWrapper.Throwable
  java.lang.NoSuchMethodError: org.glassfish.jersey.message.filtering.EntityFilteringFeature.enabled(Ljavax/ws/rs/core/Configuration;)Z
      at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:88)
      at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
      at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
      at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:829)
      at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:453)
      at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
      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.processWithException(Errors.java:255)
      at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347)
      at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  
  Sep 18, 2016 6:11:14 PM org.apache.catalina.core.StandardContext loadOnStartup
  SEVERE: Servlet /messanger threw load() exception
  java.lang.NoSuchMethodError: org.glassfish.jersey.message.filtering.EntityFilteringFeature.enabled(Ljavax/ws/rs/core/Configuration;)Z
      at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:88)
      at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
      at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
      at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:829)
      at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:453)
      at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
      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.processWithException(Errors.java:255)
      at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347)
      at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p><strong><em>and when removed version info from pom getting below error</em></strong></p>
  
  <pre><code>Sep 18, 2016 6:27:57 PM org.apache.catalina.core.ApplicationContext log
  SEVERE: StandardWrapper.Throwable
  java.lang.NoClassDefFoundError: org/glassfish/jersey/moxy/json/internal/ConfigurableMoxyJsonProvider
      at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:92)
      at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
      at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
      at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:829)
      at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:453)
      at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
      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.processWithException(Errors.java:255)
      at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347)
      at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  
  Sep 18, 2016 6:27:57 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Allocate exception for servlet Jersey Web Application
  java.lang.NoClassDefFoundError: org/glassfish/jersey/moxy/json/internal/ConfigurableMoxyJsonProvider
      at org.glassfish.jersey.moxy.json.MoxyJsonFeature.configure(MoxyJsonFeature.java:92)
      at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
      at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
      at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:829)
      at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:453)
      at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
      at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
      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.processWithException(Errors.java:255)
      at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347)
      at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
      at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>