Uploaded image for project: 'Spring AMQP'
  1. Spring AMQP
  2. AMQP-770

Jackson2JsonMessageConverter constructor change breaks reflection instantiation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.7.4
    • Fix Version/s: 1.7.5, 1.6.12, 2.0 RC2
    • Component/s: Core
    • Labels:
      None

      Description

      After updating to Spring Platform Brussels-SR5 our canary builds started failing with the attached error message. Apparently adding the varargs parameter broke reflection instantiation. I recommend adding another constructor without the varargs argument that uses the default *. This fixes it for me.

      Caused by: java.lang.NoSuchMethodError: org.springframework.amqp.support.converter.Jackson2JsonMessageConverter.<init>(Lcom/fasterxml/jackson/databind/ObjectMapper;)V
          at de.evosec.rabbit.MessageConverterAutoConfiguration.messageConverter(MessageConverterAutoConfiguration.java:25)
          at de.evosec.rabbit.MessageConverterAutoConfiguration$$EnhancerBySpringCGLIB$$4332f981.CGLIB$messageConverter$0(<generated>)
          at de.evosec.rabbit.MessageConverterAutoConfiguration$$EnhancerBySpringCGLIB$$4332f981$$FastClassBySpringCGLIB$$7d9557b.invoke(<generated>)
          at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
          at de.evosec.rabbit.MessageConverterAutoConfiguration$$EnhancerBySpringCGLIB$$4332f981.messageConverter(<generated>)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
          ... 80 more
      
      MessageConverterAutoConfiguration.java
      @Bean
      @ConditionalOnMissingBean(MessageConverter.class)
      public MessageConverter messageConverter(
              Jackson2ObjectMapperBuilder builder) {
      	ObjectMapper jsonObjectMapper = builder.createXmlMapper(false).build()
      	    .enableDefaultTyping(DefaultTyping.NON_FINAL);
      	return new Jackson2JsonMessageConverter(jsonObjectMapper);
      }
      

        Attachments

          Activity

            People

            • Assignee:
              abilan Artem Bilan
              Reporter:
              arlo Arlo O'Keeffe
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: