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

Minecraft Forge 1.9+ MDK - Registering a basic untextured item not working
Why are my fields initialized to null or to the default value of zero when I've declared and initialized them in my class' constructor?
Deploying the GraphAware friendship-counter example to some standalone neo4j server
Check if a string contains a substring AND save the string from that point
Why ThreadPoolExecutor$Worker extends AbstractQueuedSynchronizer
How to unmarshal custom types with JiBX and jibx-maven-plugin
Error: Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 2
Two panels in one big panel,panels won't show well [duplicate]
Android: Can't open existing file? [duplicate]
How to share custom parcelable object into AlarmManager receiver on android api level 24+?
list of files in a directory javafx
javac: directory not found: bin Usage: javac <options> <source files> ubuntu
How to schedule all jobs stored in database using quartz and spring boot
Consuming OffsetDateTime in Jersey
unable to re-loop through a while loop successfully
java nested for loop spaces and numbers

Categories

HOME
xamarin
openlayers
mediawiki
dictionary
hashmap
relay
cplex
framework7
amortized-analysis
rubygems
ravendb
in-app-purchase
constraint-programming
portia
facebook-messenger-bot
primary-key
google-translate
adobe-analytics
task
messages
percona
foselasticabundle
progressive-web-apps
firefox-webextensions
google-pagespeed
visual-composer
swiftlint
extjs5
tdd
bootstrap-duallistbox
internet-explorer-9
buck
dbclient
newline
uiswipegesturerecognizer
geopositioning
amazon-kinesis-kpl
plsql-psp
c11
impersonation
unoconv
node-gyp
nxlog
qcombobox
babel-core
apple-news
flickr-api
taffy
jquery-validate
boost-preprocessor
sqlbulkcopy
linode
dynamics-sl
azure-sdk
probability-density
pcf
connect-by
hexdump
nessus
ios4
rhino-servicebus
system.management
formatjs
clicktag
codeigniter-routing
gulp-less
googlemock
valuechangelistener
poller
rtmfp
intentservice
mcts
oam
geos
soundtouch
excel-2003
ora-00911
gwt-rpc
jelly
ocunit
delphi-6
bitsharp
first-responder
onsubmit
qt-jambi
external-accessory
heartbeat
f#-powerpack
self-extracting
gdlib
sql-server-profiler
iphone-web-app
lang
nhibernate.search
dbal
asp.net-profiles
ncqrs
uimenucontroller
swing-app-framework
eqatec
phonon
project-hosting
signal-handling
rtml

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App