Spring : FasterXML cannot access a member of class with modifiers private

筅森魡賤 提交于 2019-12-06 06:21:10

See https://github.com/FasterXML/jackson-databind/issues/851

This seems to be an issue in Jackson 2 pre-2.4.0. Having Jackson 1 also on classpath doesn't seem ideal, but should be irrelevant as they occupy entirely different package namespaces.

I got this error when I returned void from a Spring MVC controller method. Returning an empty String fixed it. The working method looks something like:

@RequestMapping(value="/deleteWidget", method=RequestMethod.POST)
@ResponseBody
public String deleteWidget(HttpServletRequest request) {
    widgetService.deleteWidget(request.getParameter("widgetId"));
    return "";
}

the function you called should have return value(string, or null, ect.). the function shouldn't be void.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!