org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Why Does Grizzly Return 500 "Request Failed" when I use Jackson to return JSON?

    Stack Overflow | 7 months ago | Geoffrey Hendrey
    org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

Root Cause Analysis

  1. java.lang.NoSuchMethodError

    com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

    at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector._fullSerializationType()
  2. Jackson-module-JAXB-annotations
    JaxbAnnotationIntrospector.findSerializationContentConverter
    1. com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector._fullSerializationType(JaxbAnnotationIntrospector.java:1465)
    2. com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector._findContentAdapter(JaxbAnnotationIntrospector.java:1401)
    3. com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.findSerializationContentConverter(JaxbAnnotationIntrospector.java:804)
    3 frames
  3. Jackson
    ObjectWriter.writeValue
    1. com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findSerializationContentConverter(AnnotationIntrospectorPair.java:372)
    2. com.fasterxml.jackson.databind.ser.std.StdSerializer.findConvertingContentSerializer(StdSerializer.java:417)
    3. com.fasterxml.jackson.databind.ser.std.MapSerializer.createContextual(MapSerializer.java:346)
    4. com.fasterxml.jackson.databind.SerializerProvider.handlePrimaryContextualization(SerializerProvider.java:928)
    5. com.fasterxml.jackson.databind.ser.AnyGetterWriter.resolve(AnyGetterWriter.java:89)
    6. com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.resolve(BeanSerializerBase.java:350)
    7. com.fasterxml.jackson.databind.ser.SerializerCache.addAndResolveNonTypedSerializer(SerializerCache.java:197)
    8. com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1177)
    9. com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:490)
    10. com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:688)
    11. com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
    12. com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1428)
    13. com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:930)
    13 frames
  4. Jackson-JAXRS-base
    ProviderBase.writeTo
    1. com.fasterxml.jackson.jaxrs.base.ProviderBase.writeTo(ProviderBase.java:650)
    1 frame
  5. Jersey Core
    WriterInterceptorExecutor.proceed
    1. org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
    2. org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
    3. org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    3 frames
  6. jersey-core-server
    JsonWithPaddingInterceptor.aroundWriteTo
    1. org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106)
    1 frame
  7. Jersey Core
    WriterInterceptorExecutor.proceed
    1. org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    1 frame
  8. jersey-core-server
    MappableExceptionWrapperInterceptor.aroundWriteTo
    1. org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86)
    1 frame
  9. Jersey Core
    MessageBodyFactory.writeTo
    1. org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    2. org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
    2 frames
  10. jersey-core-server
    ServerRuntime$2.run
    1. org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)
    2. org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
    3. org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
    4. org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
    4 frames
  11. Jersey Core
    RequestScope.runInScope
    1. org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    2. org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    3. org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    4. org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    5. org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    6. org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    6 frames
  12. jersey-core-server
    ApplicationHandler.handle
    1. org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    2. org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    2 frames
  13. jersey-container-grizzly2-http
    GrizzlyHttpContainer.service
    1. org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384)
    1 frame
  14. Grizzly Server
    HttpHandler$1.run
    1. org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
    1 frame
  15. Grizzly
    AbstractThreadPool$Worker.run
    1. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    2. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    2 frames
  16. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame