java


org.springframework.web.servlet.mvc.support.DefaultHandlerEx‌​ceptionResolver [duplicate]


Here I am Using LocalDate class of java 1.8.In my bean I took return type as LocalDate. And I am sending date formate as 07/01/2017. when I am trying to save that I am getting follwing exception.
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver] (default task-33) Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not instantiate value of type [simple type, class java.time.LocalDate] from String value ('07/01/2017'); no single-String constructor/factory method
at [Source: java.io.PushbackInputStream#39959f38; line: 1, column: 650] (through reference chain: com.pro.bean.ParentBean["Soici"]->com.pro.bean.Soici["fecha_de_solicitud"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class java.time.LocalDate] from String value ('07/01/2017'); no single-String constructor/factory method
at [Source: java.io.PushbackInputStream#39959f38; line: 1, column: 650] (through reference chain: com.pro.bean.ParentBean["Soici"]->com.pro.bean.Soici["fecha_de_solici"])
Add com.fasterxml.jackson.datatype-jsr310 dependency
Then configure Jackson2ObjectMapper with
#Bean(name = "OBJECT_MAPPER_BEAN")
public ObjectMapper jsonObjectMapper() {
return Jackson2ObjectMapperBuilder.json()
.serializationInclusion(JsonInclude.Include.NON_NULL) // Don’t include null values
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) //ISODate
.modules(new JSR310Module())
.build();
}
SOURCE: https://blog.oio.de/2015/06/13/add-support-for-java-8-date-time-api-to-jackson-serialized-rest-web-services/

Related Links

Behavior of Multithreaded programs in different OS
Java replaceAll with regex only replacing first instance
Dependency injection in static and dynamic languages [closed]
Jersey 2.21 Web.XML NoSuchMethod Error
How do I find the sum of all odd digits of user input numeric string?
How to resolve included schema types in .xsd
DOM4J Read Regex BUG
Spring Social login with OAuth token
Pick 4 Cards Homework
Why is jmsTemplate always null? Using spring and Apache ActiveMQ [duplicate]
JPA entitymanager different identities
Background thread creation in Weblogic SOAP Webservice using Executor framework
How to handle connection reset error in socket program
how do i send saved data to an email address
Calculating scores using user input
Check if a List<Object> contains a property

Categories

HOME
date
cloud
keycloak
minimum-spanning-tree
fluentd
comparison
raspberry-pi
react-router
youtube-dl
jsp-tags
at-command
jsrender
cakephp-2.5
pivotal-cloud-foundry
django-imagekit
mouse
in-app-purchase
constraint-programming
autotools
pheatmap
slurm
quicklook
modx-revolution
moonmail
oracle-coherence
visual-composer
cloudhub
arabic
google-search-api
blazemeter
shopware
xpages-ssjs
django-storage
replaceall
unboundid
key-value-observing
preg-match-all
data-manipulation
oracle-fusion-middleware
jspresso
winrt-xaml-toolkit
grails-3.1
atl
disassembling
qwerty
ssjs
sqlite2
jna
trim
ensembles
ncalc
nomethoderror
spring-security-kerberos
executenonquery
wso2carbon
flickr-api
filepicker
upstart
paxos
sage-one
drupal-6
csound
typed-lambda-calculus
namecoin
lync-client-sdk
color-profile
root-framework
cubes
color-picker
passport-google-oauth
ado.net-entity-data-model
py2app
fuzzy-search
simplewebrtc
superstack
rhino-servicebus
two-factor-authentication
associative-array
ios8-today-widget
xna-4.0
icu4j
django-unittest
drawbitmap
ibaction
responsive-images
sysinternals
c++03
kineticjs
oxwall
tt-news
android-nested-fragment
rdtsc
yorick
rtmfp
dir
dataservice
yui-compressor
orchardcms-1.7
sharp-repository
lcs
hamiltonian-cycle
runas
viewswitcher
parametric-equations
cufon
stage
heartbeat
yetanotherforum
table-footer
netbeans-7.1
modelstate
rescale
putchar
dbisam
.net-1.0

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App