org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException in REST with Spring

后端 未结 4 1298
无人共我
无人共我 2021-01-06 19:04

I am trying to create REST service using Spring.When I try to access that service it returns proper data but shows -

Exception handling request to /RESTServ         


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-06 19:57

    If your are using maven, add JSON Databinding dependencies specified below in your pom.xml and annotate the User class with @JsonRootName(value = "user"),

        
            org.codehaus.jackson
            jackson-jaxrs
            1.9.13
        
        
            org.codehaus.jackson
            jackson-xc
            1.9.13
        
    

提交回复
热议问题