0
我使用的是新澤西州和我有以下兩種方法的RESTful:新澤西誤差@PathParam
@GET
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public List<Activity> getAllActivities() {
return activityRepository.findAllActivities();
}
和
@GET
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@PathParam("{activityId}")
public Activity getActivity(@PathParam("activityId") String activityId) {
return activityRepository.findActivity(activityId);
}
一切運作良好之前我增加了第二種方法。但是,我的tomcat現在給出了以下錯誤。
org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization.
[[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by @Consumes and @Produces annotations
任何線索?
謝謝Keerthivasan! 我只是簡單的傻笑 –
@ i_ch3ry不客氣:) – Keerthivasan