title: Jackson NoSuchMethodError requiresPropertyOrdering maven with google app engine project at runtime
body: <p>I'm trying to get an app engine maven project running and appear to have found myself in JAR hell. The project has built and run in the past without using maven, but I've had enough of Eclipse's nonsense and am trying to mavenize the project for all the usual reasons.</p>
  
  <p>Currently everything is working compiling and tests are passing (with <code>mvn clean install</code> from the <code>myproject-war</code> directory <a href="https://developers.google.com/appengine/docs/java/gettingstarted/creating" rel="nofollow noreferrer">shown here</a>). I'm also able to launch <code>mvn appengine:devserver</code> from my <code>myproject-ear</code> directory and get the server running. Navigating to one of my servlets, however, I get the <code>noSuchMethodError</code> trace shown below. (All code is at the bottom for readability).</p>
  
  <p>This looks similar to <a href="https://stackoverflow.com/questions/23823106/two-maven-dependency-for-latest-and-old-version-conflicts">other posts</a> where jackson versions weren't in sync. However, my jackson versions seem to be ok, as can be seen in my <code>pom.xml</code>, also at the bottom. It appears that that method <a href="http://www.grepcode.com/search/?query=JsonFactory.requiresPropertyOrdering" rel="nofollow noreferrer">didn't appear until Jackson 3.0</a>, which again seems ok because of the output of <code>mvn dependency:tree -Dverbose | ack jackson</code> and the fact that I'm depending on <code>2.4.1</code>.</p>
  
  <p>The most likely culprit I can think of is the google library, which I'm using because I'm following the <a href="http://android-developers.blogspot.in/2013/01/verifying-back-end-calls-from-android.html" rel="nofollow noreferrer">example here</a> which appears to rely on it. However, I'm not really sure how to go about testing that hypothesis or getting the google library to work without its dependency. Perhaps the <code>&lt;exlcudes&gt;</code> tag, but I'm not sure how I would apply it. </p>
  
  <p>Does anyone have any suggestions or things I'm missing? How can I get the correct version of the class to be used at runtime? Or am I missing something and the solution is something entirely different?</p>
  
  <p><strong>EDIT</strong>: Note that on the advice of a comment/answer I have ensured that all of the libraries I am responsible for use the same version of fasterxml/Jackson rather than the older codehaus packaing. I agree that it appears that there is still an older dependency somewhere causing problems, but that is precisely the problem I am struggling to correct.</p>
  
  <p><strong>EDIT 2</strong>: I eventually got this working as I cleaned up the overall project and dependency structure, although I can't provide the exacty fix as to why. I think the issue was due to this dependency:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
    &lt;artifactId&gt;jackson-jaxrs-json-provider&lt;/artifactId&gt;
    &lt;version&gt;2.4.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>It <a href="http://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.4.1" rel="nofollow noreferrer">has a dependency</a> on <code>org.jboss.resteasy:resteasy-jackson2-provider:3.0.6.Final</code>, which itself <a href="http://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jackson2-provider/3.0.6.Final" rel="nofollow noreferrer">depends on</a> <code>com.fasterxml.jackson.core:jackson-databind:2.2.1</code>, which doesn't have the missing method, as I pointed out in my original post.</p>
  
  <p><code>mvn dependency:tree -Dverbose | ack jackson</code>:</p>
  
  <pre><code>[INFO] +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.4.1:compile
  [INFO] |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.4.1:compile
  [INFO] |  |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |  +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |  +- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.4.1:compile
  [INFO] |     +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |     \- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.1:compile - omitted for duplicate)
  [INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile
  [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.1:compile
  [INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile
  [INFO] |  \- (com.fasterxml.jackson.core:jackson-core:jar:2.4.1:compile - omitted for duplicate)
  [INFO] |  +- com.google.http-client:google-http-client-jackson2:jar:1.19.0:compile
  [INFO] |  |  \- (com.fasterxml.jackson.core:jackson-core:jar:2.1.3:compile - omitted for conflict with 2.4.1)
  [INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:test
  [INFO] |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:test
  </code></pre>
  
  <p>Exception trace:</p>
  
  <pre><code>java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
      at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:458)
      at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:379)
      at com.fasterxml.jackson.jaxrs.json.JsonMapperConfigurator.getDefaultMapper(JsonMapperConfigurator.java:44)
      at com.fasterxml.jackson.jaxrs.base.ProviderBase.locateMapper(ProviderBase.java:856)
      at com.fasterxml.jackson.jaxrs.base.ProviderBase.writeTo(ProviderBase.java:588)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:129)
      at org.jboss.resteasy.core.interception.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:62)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:118)
      at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
      at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122)
      at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:99)
      at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:427)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:376)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
      at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  </code></pre>
  
  <p>My <code>pom.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/xsd/maven-4.0.0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;groupId&gt;org.mygroupid&lt;/groupId&gt;
  &lt;artifactId&gt;myproject-server-war&lt;/artifactId&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.mygroupid&lt;/groupId&gt;
      &lt;artifactId&gt;myproject-server&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;appengine.app.version&gt;1-war&lt;/appengine.app.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;!-- Compile/runtime dependencies --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
          &lt;artifactId&gt;appengine-api-1.0-sdk&lt;/artifactId&gt;
          &lt;version&gt;${appengine.target.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;jstl&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;mysql&lt;/groupId&gt;
        &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;version&gt;5.1.31&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-jaxrs-json-provider&lt;/artifactId&gt;
        &lt;version&gt;2.4.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
        &lt;version&gt;2.4.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
        &lt;version&gt;2.4.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;joda-time&lt;/groupId&gt;
        &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
        &lt;version&gt;2.3&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;4.2.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate.common&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
        &lt;version&gt;4.0.4.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
        &lt;version&gt;3.0.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.google.api-client&lt;/groupId&gt;
        &lt;artifactId&gt;google-api-client&lt;/artifactId&gt;
        &lt;version&gt;1.19.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;com.google.api-client&lt;/groupId&gt;
        &lt;artifactId&gt;google-api-client-gson&lt;/artifactId&gt;
        &lt;version&gt;1.19.0&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;!-- Our custom common jar. --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;groupid&lt;/groupId&gt;
          &lt;artifactId&gt;myproject-common&lt;/artifactId&gt;
          &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Test Dependencies --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
          &lt;artifactId&gt;appengine-testing&lt;/artifactId&gt;
          &lt;version&gt;${appengine.target.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
          &lt;artifactId&gt;appengine-api-stubs&lt;/artifactId&gt;
          &lt;version&gt;${appengine.target.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.10&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
          &lt;version&gt;1.9.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;groupdId&lt;/groupId&gt;
          &lt;artifactId&gt;myproject-common&lt;/artifactId&gt;
          &lt;version&gt;0.1-SNAPSHOT&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
        &lt;version&gt;1.9.13&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.easytesting&lt;/groupId&gt;
        &lt;artifactId&gt;fest-assert-core&lt;/artifactId&gt;
        &lt;version&gt;2.0M10&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;outputDirectory&gt;target/${project.artifactId}-${project.version}/WEB-INF/classes&lt;/outputDirectory&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;3.1&lt;/version&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;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;archiveClasses&gt;true&lt;/archiveClasses&gt;
                  &lt;webResources&gt;
                      &lt;!-- in order to interpolate version from pom into appengine-web.xml --&gt;
                      &lt;resource&gt;
                          &lt;directory&gt;${basedir}/src/main/webapp/WEB-INF&lt;/directory&gt;
                          &lt;filtering&gt;true&lt;/filtering&gt;
                          &lt;targetPath&gt;WEB-INF&lt;/targetPath&gt;
                      &lt;/resource&gt;
                  &lt;/webResources&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>