org.springframework.beans.factory
public class: NoSuchBeanDefinitionException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.factory.NoSuchBeanDefinitionException
All Implemented Interfaces:
Serializable
Exception thrown when a BeanFactory is asked for a bean
instance name for which it cannot find a definition.
- author:
Rod - Johnson
- author:
Juergen - Hoeller
| Constructor: |
public NoSuchBeanDefinitionException(String name) {
super("No bean named '" + name + "' is defined");
this.beanName = name;
}
Create a new NoSuchBeanDefinitionException. Parameters:
name - the name of the missing bean
|
public NoSuchBeanDefinitionException(String name,
String message) {
super("No bean named '" + name + "' is defined: " + message);
this.beanName = name;
}
Create a new NoSuchBeanDefinitionException. Parameters:
name - the name of the missing bean
message - detailed message describing the problem
|
public NoSuchBeanDefinitionException(Class type,
String message) {
super("No unique bean of type [" + type.getName() + "] is defined: " + message);
this.beanType = type;
}
Create a new NoSuchBeanDefinitionException. Parameters:
type - required type of bean
message - detailed message describing the problem
|
public NoSuchBeanDefinitionException(Class type,
String dependencyDescription,
String message) {
super("No matching bean of type [" + type.getName() + "] found for dependency [" +
dependencyDescription + "]: " + message);
this.beanType = type;
}
Create a new NoSuchBeanDefinitionException. Parameters:
type - required type of bean
dependencyDescription - a description of the originating dependency
message - detailed message describing the problem
|
| Methods from org.springframework.beans.BeansException: |
|---|
|
equals, hashCode |
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from org.springframework.beans.factory.NoSuchBeanDefinitionException Detail: |
public String getBeanName() {
return this.beanName;
}
Return the name of the missing bean,
if it was a lookup by name that failed. |
public Class getBeanType() {
return this.beanType;
}
Return the required type of bean,
if it was a lookup by type that failed. |