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;

  1. 0

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

    Stack Overflow | 4 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;
  2. 0

    GitHub comment 78#182787263

    GitHub | 10 months ago | robertgmoss
    java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;
  3. 0

    SpringMVC转换Json 出错.java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.t_「电脑玩物」中文网我们只是「电脑玩物」 -

    07net01.com | 8 months ago
    java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring 4.2.3 and fasterxml Jackson 2.7.0 are incompatible

    Stack Overflow | 11 months ago | Marek Raszewski
    java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;
  6. 0

    {{AbstractJackson2HttpMessageConverter.getJavaType}} calls {{objectMapper.getTypeFactory().constructType(type, contextClass)}}. In Jackson 2.7+, they modified the signature of {{constructType}} and it doesn't take a 2nd {{Class}} argument anymore. This is breaking everything that uses the {{AbstractJackson2HttpMessageConverter}}, including {{RestTemplate}} and controllers that output JSON. {{AbstractJackson2HttpMessageConverter}} claims that it is "Compatible with Jackson 2.1 and higher." but that's not true anymore. The newer Jackson has features that are very desirable, like customization options for JDK8 date time, so downgrading is not a viable option for modern clients. Sample stacktrace: {code} java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType; at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.getJavaType(AbstractJackson2HttpMessageConverter.java:311) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.canRead(AbstractJackson2HttpMessageConverter.java:146) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.canRead(AbstractJackson2HttpMessageConverter.java:141) at org.springframework.web.client.RestTemplate$AcceptHeaderRequestCallback.doWithRequest(RestTemplate.java:706) at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:769) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:594) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:493) {code}

    Spring JIRA | 11 months ago | Abhijit Sarkar
    java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/reflect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

  1. mauritius 1 times, last 8 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

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