Spring Framework
  1. Spring Framework
  2. SPR-7924

Unable to configure MappingJacksonHttpMessageConverter created by AnnotationDrivenBeanDefinitionParser

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.1 M1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser
      executes
      messageConverters.add(createConverterBeanDefinition(MappingJacksonHttpMessageConverter.class, source));
      at line 187 in spring-webmvc-3.0.5.RELEASE

      There is no way that I'm aware of to configure the created MappingJacksonHttpMessageConverter instance.

      I'd need to set the ObjectMapper of this instance so it's able to use my MixIn configuration (special handling of certain data types defined using serializationConfig.addMixInAnnotations or deserializationConfig.addMixInAnnotations) and other ObjectMapper configuration.

      Otherwise, serializing e.g. a java.awt.Dimension is guaranteed to explode.

      Is there any way to configure it that I'm missing? I searched quite extensive but couldn't find anything so far. Any workaround would be highly appreciated, even a hacky, temporary one...

      This issue may be related to SPR-6731.

        Activity

        Hide
        Rossen Stoyanchev added a comment -

        Support for configuring message converters has been added to the MVC namespace and will be available in 3.1 M1.

        Show
        Rossen Stoyanchev added a comment - Support for configuring message converters has been added to the MVC namespace and will be available in 3.1 M1.
        Hide
        Joern Huxhorn added a comment -

        Every issue I could find so far was referring to the ConversionService and I'm not sure if my requirement of being able to configure the ObjectMapper is met, yet.

        Could you please give me a pointer to more some more infos, e.g. the issue this issue duplicates, some docs about the upcoming MVC namespace changes, pointer to the related source, a possible workaround for the problem at hand?

        The related forum post is http://forum.springsource.org/showthread.php?p=342898

        I'll reopen this bug simply because I'm not sure if you'd get notified of my comment if I don't.
        Thanks for the fast response.

        Show
        Joern Huxhorn added a comment - Every issue I could find so far was referring to the ConversionService and I'm not sure if my requirement of being able to configure the ObjectMapper is met, yet. Could you please give me a pointer to more some more infos, e.g. the issue this issue duplicates, some docs about the upcoming MVC namespace changes, pointer to the related source, a possible workaround for the problem at hand? The related forum post is http://forum.springsource.org/showthread.php?p=342898 I'll reopen this bug simply because I'm not sure if you'd get notified of my comment if I don't. Thanks for the fast response.
        Hide
        Joern Huxhorn added a comment -

        See last comment.

        Show
        Joern Huxhorn added a comment - See last comment.
        Hide
        Rossen Stoyanchev added a comment -

        Yes, I forgot to include a reference to the ticket indeed, my apologies! See this comment under SPR-7504 for example configuration.

        Show
        Rossen Stoyanchev added a comment - Yes, I forgot to include a reference to the ticket indeed, my apologies! See this comment under SPR-7504 for example configuration.
        Hide
        Joern Huxhorn added a comment -

        This looks quite good indeed!
        Any idea about a release date of the milestone? A rough guess would be enough...

        Show
        Joern Huxhorn added a comment - This looks quite good indeed! Any idea about a release date of the milestone? A rough guess would be enough...
        Hide
        Rossen Stoyanchev added a comment -

        You can build against 3.1.0.BUILD-SNAPSHOT already. As for the milestone I don't have any dates but I can recommend the webinar on Spring 3.1 next week (see http://www.springsource.com/newsevents/webinars).

        Show
        Rossen Stoyanchev added a comment - You can build against 3.1.0.BUILD-SNAPSHOT already. As for the milestone I don't have any dates but I can recommend the webinar on Spring 3.1 next week (see http://www.springsource.com/newsevents/webinars ).

          People

          • Assignee:
            Rossen Stoyanchev
            Reporter:
            Joern Huxhorn
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 11 weeks, 1 day ago