Jodatime Library not available-@DateTimeFormat not supported

Source: Internet
Author: User

When using spring's @datetimeformat to format the date type, an error occurs:

Org.springframework.validation.bindexception:org.springframework.validation.beanpropertybindingresult:1 errors
Field error in object ' Modelinfoexample ' on field ' birthday ':
Rejected value [2014-12-09];
codes [Typemismatch.modelinfoexample.birthday,typemismatch.birthday,typemismatch.java.util.date,typemismatch];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable:
codes [Modelinfoexample.birthday,birthday]; arguments []; Default message [birthday]];
Default message [Failed to convert property value of type ' java.lang.String ' to required type ' java.util.Date '
For the property ' birthday '; Nested exception is org.springframework.core.convert.ConversionFailedException:
Failed to convert from type java.lang.String to type @org. Springframework.format.annotation.DateTimeFormat
Java.util.Date for value ' 2014-12-09 '; Nested exception is
Java.lang.IllegalStateException:JodaTime Library not available-@DateTimeFormat not supported]

Obviously, it is true that the Jodatime library, which joins its dependencies in Pom.xml, is done:

<dependency><groupId>joda-time</groupId><artifactId>joda-time</artifactId>< Version>2.6</version></dependency>

Jodatime Library not available-@DateTimeFormat not supported

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.