Failed to convert value of type [java.lang.String] to required type [java.util.Optional]

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web53

  • via Unknown by James Howe,
  • via Unknown by James Howe,
  • via Unknown by Webbug Group,
  • Stack trace

    • org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type [java.lang.String] to required type [java.util.Optional] at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument( at at at Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestHeader java.time.Instant] for value 'Thu, 21 Apr 2016 17:11:08 +0100' at at at at at at org.springframework.beans.TypeConverterDelegate.convertIfNecessary( at org.springframework.beans.TypeConverterDelegate.convertIfNecessary( at org.springframework.beans.TypeConverterSupport.doConvert( at org.springframework.beans.TypeConverterSupport.convertIfNecessary( at org.springframework.validation.DataBinder.convertIfNecessary( at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument( ... 4 more Caused by: java.time.format.DateTimeParseException: Text 'Thu, 21 Apr 2016 17:11:08 +0100' could not be parsed at index 0 at java.time.format.DateTimeFormatter.parseResolved0( at java.time.format.DateTimeFormatter.parse( at java.time.Instant.parse( at org.springframework.format.datetime.standard.InstantFormatter.parse( at org.springframework.format.datetime.standard.InstantFormatter.parse( at$ParserConverter.convert( at ... 15 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Михайло ТітовМихайло Тітов
    13 times, last one
    3 times, last one
    11 more bugmates