1. 程式人生 > >org.springframework.http.converter.HttpMessageNotReadableException: Could not read document:

org.springframework.http.converter.HttpMessageNotReadableException: Could not read document:

在使用jquery的ajax傳遞json資料的時候報錯:

org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Unrecognized token 'id': was expecting ('true', 'false' or 'null')
 at [Source: [email protected]31a18c9e; line: 1, column: 4]; nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token
'id': was expecting ('true', 'false' or 'null') at [Source: [email protected]31a18c9e; line: 1, column: 4] at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:240) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read
(AbstractJackson2HttpMessageConverter.java:225) at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:201) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:150
) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:128) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:160) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'id': was expecting ('true', 'false' or 'null') at [Source: [email protected]31a18c9e; line: 1, column: 4] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3528) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2686) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:878) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:772) at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3834) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3783) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2922) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:237) ... 43 common frames omitted

解決辦法:
在傳遞資料的時候加上

JSON.stringify(),

如::
這裡寫圖片描述

如果還報錯:看看action方法是否設定成功
這裡寫圖片描述

相關推薦

org.springframework.http.converter.HttpMessageNotReadableException: Could not read document:

在使用jquery的ajax傳遞json資料的時候報錯: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Unreco

org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite r

org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (StackOverflowError); nested exception

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deseri

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `sds.db.dao.User` out of STA

org.springframework.http.converter.HttpMessageNotReadableException:

HttpMessageNotReadableException報錯解決方法 @requestBody這個標籤在post 、put 方法中用於接收json格式的資料 @requestParam這個標籤接收的是key-value形式的引數。

Springmvc 中org.springframework.http.converter.json.MappingJackson2HttpMessageConverter依賴jackson包

otf dha 配置 beans framework 依賴包 ans cep tpm 1,問題詳情:Spring使用4.3.5.Release版本後 在SpringMvc配置文件中配置json 解析器後出現報錯信息 [org.springframework.w

報錯:org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

log beans 而在 itme manager 解決辦法 man ali hand org.springframework.http.converter.json.MappingJacksonHttpMessageConverter 1、錯誤描述 嚴重:

spring boot 上傳檔案出錯:org.springframework.web.multipart.MultipartException: Could not parse multipart s

一個國慶假期回來,測試跟我說以前好好的檔案上傳不能用了,還是真實環境,程式報如下錯誤: org.springframework.web.multipart.MultipartException: Cou

org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException:

感覺自己找的錯毫無理由,就是錯了,而且不知道原因 <bean id="commonsMultipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">

java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJacksonHttpMessageC

spring MVC使用JSON時報異常:  java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

Could not read document: Can not deserialize instance of java.lang.xxx out of START_OBJECT token

Java 專案中遇到的問題:Could not read document: Can not deserialize instance of java.lang.String out of START_OBJECT token 前些日子在專案中遇到這樣一個問

jenkins gogs 通過git部署 遇到的問題 fatal: could not read Username for 'http://47.92.55.118:3000': No such d

jenkins gogs 通過git部署  遇到的問題 fatal: could not read Username for 'http://47.92.55.118:3000': No such d       遇到這個錯,網上找了一圈也沒有

jenkins gogs 通過git部署 遇到的問題 fatal: could not read Username for 'http://47.92.55.118:3000': No such d

jenkins gogs 通過git部署  遇到的問題 fatal: could not read Username for 'http://47.92.55.118:3000': No such d 遇到這個錯,網上找了一圈也沒有找到方法,最後在伺服器執行了g

git: fatal: Could not read from remote repository

nag fatal choose native tell ack arch manage fat This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij

log4j:ERROR Could not read configuration file [log4j.properties]

clas fig erro config 錯誤 程序 pos 遇到 could not 遇到這個錯誤,程序能夠正常運行,log4j.properties也在classpath中,後來在網上查了資料,把下面這個語句去掉就好啦。 PropertyConfigurator.con

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

please sudo _id ima upd cal .com root pin 第一次提交遇到這樣的情況,怎麽回事呢,我在github上提交了ssh key 的啊。 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 ho

git "Could not read from remote repository.Please make sure you have the correct access rights."解決方案

tpc 覆蓋 com 設置 _id pub ould ack ref 我們在使用git clone 或其他命令的時候,有時候會遇到這類問題,如圖: fatal: Could not read from remote repository. Please make s

hexo could not read form 問題

ast body 技術 -m markdown size 畫線 not orm 把https 的改成下面這種形式的,註意我畫線的,我整了好久 就是標點符號不對!!! hexo could not read form 問題

git提示錯誤關於錯誤:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

eight 無法讀取 主機名 github上 錯誤2 winsock nal file drive 關於 Git 使用中出現的錯誤 饑人谷_楠柒 關註 2016.11.02 15:33* 字數 746 閱讀 3607評論 5喜歡 10贊賞 1 關

Permission denied (publickey). fatal: Could not read from remote repository.

ech IT git 生成 兩個文件 tin 一個 繼續 con 執行語句git push -u origin master的時候出現下面的錯誤 Permission denied (publickey).fatal: Could not read from remo

ionic真機調試Android報錯 - could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

找到 管理器 and nic sid ask err span adb 在使用真機調試Android程序時,報錯如下: could not read ok from ADB Server * failed to start daemon error: cannot con