You are calling GET /stuff/foo&bar=someValue
You should be calling GET /stuff/foo?bar=someValue
RESTEasy is trying to parse foo&bar=someValue
as the {id}
field.
I can't give you an answer about RESTEasy URL priorities but you could do this:
@GET
@Path("/stuff/{id}")
public Response getById(@PathParam("id") String id, @QueryParam("bar") String bar) {
try {
int intId = Integer.parseInt(id);
// do int id things
} catch(NumberFormatException e) {
// do foo + bar things
}
}