Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 弹簧座获得错误500_Spring_Rest_Model View Controller - Fatal编程技术网

Spring 弹簧座获得错误500

Spring 弹簧座获得错误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

我有一个应用程序,我使用rest。当我尝试访问RESTURL时,我得到错误500

@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调用的客户端上不会有任何列表功能。