Example usage for org.springframework.beans.factory NoSuchBeanDefinitionException toString

List of usage examples for org.springframework.beans.factory NoSuchBeanDefinitionException toString

Introduction

In this page you can find the example usage for org.springframework.beans.factory NoSuchBeanDefinitionException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:com.google.enterprise.connector.persist.MigrateStore.java

/**
 * Returns the named PersistentStore instance.
 *//*from  w  w  w .  j a v  a 2 s  .  c o m*/
private PersistentStore getPersistentStoreByName(String name) {
    try {
        PersistentStore store = (PersistentStore) Context.getInstance().getApplicationContext().getBean(name,
                PersistentStore.class);
        if (store == null) {
            System.err.println("No PersistentStore named " + name + " was found.");
        }
        return store;
    } catch (NoSuchBeanDefinitionException e) {
        System.err.println("No PersistentStore named " + name + " was found.");
    } catch (BeansException e) {
        System.err.println("Spring failure - can't instantiate " + name + ": (" + e.toString() + ")");
    }
    return null;
}