Incorrect bean definition for error messages