Example usage for org.springframework.beans.factory BeanIsAbstractException getMessage

List of usage examples for org.springframework.beans.factory BeanIsAbstractException getMessage

Introduction

In this page you can find the example usage for org.springframework.beans.factory BeanIsAbstractException getMessage.

Prototype

@Override
@Nullable
public String getMessage() 

Source Link

Document

Return the detail message, including the message from the nested exception if there is one.

Usage

From source file:org.jasig.cas.web.report.InternalConfigStateController.java

/**
 * Gets beans in the application context.
 *
 * @param ctx the ctx/*from   ww w .j  a  v  a 2s .c  om*/
 * @return the beans
 */
private static Map<String, Object> getBeans(final ApplicationContext ctx) {
    final String[] all = BeanFactoryUtils.beanNamesIncludingAncestors(ctx);

    final Map<String, Object> singletons = new HashMap<>(all.length);
    for (final String name : all) {
        try {
            final Object object = ctx.getBean(name);
            if (object != null) {

                boolean foundPackage = false;
                final String packageName = object.getClass().getPackage().getName();
                for (int i = 0; !foundPackage && i < INCLUDE_PACKAGES.length; i++) {
                    foundPackage = (packageName.startsWith(INCLUDE_PACKAGES[i]));
                }
                if (foundPackage) {
                    singletons.put(name, object);
                }

            }
        } catch (final BeanIsAbstractException e) {
            LOGGER.debug("Skipping abstract bean definition. {}", e.getMessage());
        } catch (final Throwable e) {
            LOGGER.trace(e.getMessage(), e);
        }
    }

    return singletons;
}