How can the following produce this error when they have different URLs ?
@Path("/job/{empId}/empProfile")
public EmpProfileResource delegateToEventProfileResource() {
EmpProfileResource resource = new EmpProfileResource();
locator.inject(resource);
return resource;
}
@Path("/job/{empId}/empTask")
public EmpTaskResource getClientLevelAttendees(@PathParam("clientId") long clientId){
EmpTaskResource resource = new EmpTaskResource (empId);
locator.inject(resource);
return resource;
}
@Path("/")
public class EmpTaskResource{
}
@Path("/")
public class EmpProfileResource{
}
Yes, they both are GET and produce the same, so ?
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Error:
[[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public javax.ws.rs.core.Response com.EmpTaskResource.getEmpTasks(java.time.LocalDate,java.time.LocalDate,java.lang.String) and public javax.ws.rs.core.Response com.EmpProfileResource.getEmpProfiles(long,java.lang.String) at matching regular expression /. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.;