Spring 弹簧座获得错误500
我有一个应用程序,我使用rest。当我尝试访问RESTURL时,我得到错误500Spring 弹簧座获得错误500,spring,rest,model-view-controller,Spring,Rest,Model View Controller,我有一个应用程序,我使用rest。当我尝试访问RESTURL时,我得到错误500 @RequestMapping(value = "/all", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE }) public @ResponseBody List<User> getAllUsers() { return userService.getAllUsers(); } @Requ
@RequestMapping(value = "/all", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
public @ResponseBody List<User> getAllUsers() {
return userService.getAllUsers();
}
@RequestMapping(value=“/all”,method=RequestMethod.GET,products={MediaType.APPLICATION\u JSON\u value})
public@ResponseBody列表getAllUsers(){
返回userService.getAllUsers();
}
在我的配置中,我有这个
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
<bean
class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter" />
</list>
</property>
</bean>
你能帮我吗?提前感谢500表示“内部服务器错误”。因此您得到了一个错误,堆栈跟踪应该返回和/或记录在服务器日志中。读取堆栈跟踪。如果你不能理解,就发布它。该项目使用maven tomcat,我找到的唯一日志包含:0:0:0:0:0:0:0:1---[27/Sep/2015:11:56:04+0400]“GET/market/admin/dashboard/all HTTP/1.1”500 997 HTTP-bio-8080-exec-5 127请确保正确配置日志记录。启用spring类日志记录。尝试将代码从getAllUsers()隔离为空集合。btq对于返回集合而不是列表的消息转换器来说更加优雅:rest调用的客户端上不会有任何列表功能。500表示“内部服务器错误”。因此您得到了一个错误,堆栈跟踪应该返回和/或记录在服务器日志中。读取堆栈跟踪。如果你不能理解,就发布它。该项目使用maven tomcat,我找到的唯一日志包含:0:0:0:0:0:0:0:1---[27/Sep/2015:11:56:04+0400]“GET/market/admin/dashboard/all HTTP/1.1”500 997 HTTP-bio-8080-exec-5 127请确保正确配置日志记录。启用spring类日志记录。尝试将代码从getAllUsers()隔离为空集合。btq对于返回集合而不是列表的消息转换器来说更为优雅:在rest调用的客户端上不会有任何列表功能。