Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2528

java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.getPolymorphicTypeValidator in Mock framework after migrating from 3.x to 4.5.2.Final

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 4.5.2.Final
    • jaxrs
    • None

    Description

      I'm in the middle of migrating a Java app from RESTEasy 3.X to 4.5.2.Final, using the following dependencies

          compile 'org.jboss.resteasy:resteasy-core:4.5.2.Final'
          compile 'org.jboss.resteasy:resteasy-guice:4.5.2.Final'
          compile 'org.jboss.resteasy:resteasy-servlet-initializer:4.5.2.Final'
          compile 'org.jboss.resteasy:resteasy-jackson2-provider:4.5.2.Final'
      

      and everything seems to be working fine, however, one of the unit tests leveraging the RESTeasy Mock Framework is failing with the following error:

      test500InvalidXMLContent FAILED
          java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.getPolymorphicTypeValidator()Lcom/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator;
              at org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider.writeTo(ResteasyJackson2Provider.java:231)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.lambda$writeTo$1(ServerWriterInterceptorContext.java:79)
              at org.jboss.resteasy.mock.MockHttpRequest$2.executeBlockingIo(MockHttpRequest.java:385)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:79)
              at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.syncProceed(AbstractWriterInterceptorContext.java:245)
              at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.getStarted(AbstractWriterInterceptorContext.java:170)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.lambda$getStarted$0(ServerWriterInterceptorContext.java:73)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.aroundWriteTo(ServerWriterInterceptorContext.java:93)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.getStarted(ServerWriterInterceptorContext.java:73)
              at org.jboss.resteasy.core.ServerResponseWriter.lambda$writeNomapResponse$3(ServerResponseWriter.java:162)
              at org.jboss.resteasy.core.interception.jaxrs.ContainerResponseContextImpl.filter(ContainerResponseContextImpl.java:403)
              at org.jboss.resteasy.core.ServerResponseWriter.executeFilters(ServerResponseWriter.java:251)
              at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:101)
              at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:74)
              at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:224)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:515)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:259)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:160)
              at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:362)
              at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:163)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:245)
              at com.llbean.purchase.history.processor.rest.AppExceptionMapperTest.test500InvalidXMLContent(AppExceptionMapperTest.java:134)
      

      Enclosed is the file containing the offending test case, there are other similar unit tests that are working just fine, however, this particular test is somehow complaining

      Attachments

        Activity

          People

            Unassigned Unassigned
            rvillane Mario Rodriguez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: