MethodRecord method = null;
try {
// if no method is found then a RequestMatchingException exception
// is thrown
method = registry.findMethod(resource, context);
} catch (WebApplicationException e) {
// couldn't find a method
result.setError(e);
return;
}