shimh-develop / blog-vue-springboot

基于Vue+SpringBoot构建的博客项目
1.93k stars 552 forks source link

你好,请问,为什么拉下来运行报json转换出错? #9

Open CGongsz opened 5 years ago

CGongsz commented 5 years ago

2019-04-26 12:36:54.941 ERROR com.shimh.common.controlleradvice.GlobalExceptionHandler 88 ExceptionHandler - 服务器内部错误 , uri: /articles , caused by: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: write javaBean error, fastjson version 1.2.44, class com.shimh.common.result.Result, write javaBean error, fastjson version 1.2.44, class com.shimh.entity.Article, fieldName : 0, write javaBean error, fastjson version 1.2.44, class com.shimh.entity.User_$$_jvst2121, fieldName : author; nested exception is com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.44, class com.shimh.common.result.Result, write javaBean error, fastjson version 1.2.44, class com.shimh.entity.Article, fieldName : 0, write javaBean error, fastjson version 1.2.44, class com.shimh.entity.User$$_jvst212_1, fieldName : author at com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter.writeInternal(FastJsonHttpMessageConverter.java:268) ~[fastjson-1.2.44.jar:?] at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:227) ~[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE] at com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter.write(FastJsonHttpMessageConverter.java:185) ~[fastjson-1.2.44.jar:?] at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:231) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81) ~[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) [spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) [spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) [spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.23.jar:8.5.23]

CGongsz commented 5 years ago

解决了,原来必须要有个id为1的用户

officeworker1 commented 7 months ago

为什么我在表sys_user中添加了一个id为1的用户还是报这个错呀