public class

BeanNotOfRequiredTypeException

extends BeansException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ org.springframework.core.NestedRuntimeException
           ↳ org.springframework.beans.BeansException
             ↳ org.springframework.beans.factory.BeanNotOfRequiredTypeException
Known Direct Subclasses

Class Overview

Thrown when a bean doesn't match the expected type.

Summary

Public Constructors
BeanNotOfRequiredTypeException(String beanName, Class requiredType, Class actualType)
Create a new BeanNotOfRequiredTypeException.
Public Methods
Class getActualType()
Return the actual type of the instance found.
String getBeanName()
Return the name of the instance that was of the wrong type.
Class getRequiredType()
Return the expected type for the bean.
[Expand]
Inherited Methods
From class org.springframework.beans.BeansException
From class org.springframework.core.NestedRuntimeException
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public BeanNotOfRequiredTypeException (String beanName, Class requiredType, Class actualType)

Also: SpringBeans

Create a new BeanNotOfRequiredTypeException.

Parameters
beanName the name of the bean requested
requiredType the required type
actualType the actual type returned, which did not match the expected type

Public Methods

public Class getActualType ()

Also: SpringBeans

Return the actual type of the instance found.

public String getBeanName ()

Also: SpringBeans

Return the name of the instance that was of the wrong type.

public Class getRequiredType ()

Also: SpringBeans

Return the expected type for the bean.