public class BeanNotOfRequiredTypeException extends BeansException {
private String beanName;
private Class<?> requiredType;
private Class<?> actualType;
public BeanNotOfRequiredTypeException(String beanName, Class<?> requiredType, Class<?> actualType) {
<BUG>super("Bean named '" + beanName + "' must be of type [" + requiredType.getName() +

"], but was actually of type [" + actualType.getName() + "]");
this.beanName = beanName;</BUG>
this.requiredType = requiredType;

public class BeanNotOfRequiredTypeException extends BeansException {
private String beanName;
private Class<?> requiredType;
private Class<?> actualType;
public BeanNotOfRequiredTypeException(String beanName, Class<?> requiredType, Class<?> actualType) {
super("Bean named '" + beanName + "' is expected to be of type [" + requiredType.getName() +
"] but was actually of type [" + actualType.getName() + "]");
this.beanName = beanName;
this.requiredType = requiredType;
