fix #1378 Incorrect bean definition for error messages