ResourceNotFoundException not caught