Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16932

RestController fails with java.lang.ClassCastException: java.lang.String cannot be cast to org.springframework.core.io.support.ResourceRegion

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.7, 5.1 RC1
    • Component/s: Web
    • Labels:
      None

      Description

      I have a simple @RestController implementing a method returning List<Object>. Spring 5 fails with a ClassCastException when accessing http://localhost:8080. I have created a sample project at https://github.com/torstenwerner/springwebmvcexception that reproduces the problem. Please look at the file DemoApi.java for the implementation. The web controller works with spring 4.3 and returns JSON serialized by jackson.

        Attachments

          Activity

            People

            • Assignee:
              bclozel Brian Clozel
              Reporter:
              bollin Torsten Werner
              Last updater:
              Stéphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                18 weeks ago