Example usage for org.springframework.beans BeansException getStackTrace

List of usage examples for org.springframework.beans BeansException getStackTrace

Introduction

In this page you can find the example usage for org.springframework.beans BeansException getStackTrace.

Prototype

public StackTraceElement[] getStackTrace() 

Source Link

Document

Provides programmatic access to the stack trace information printed by #printStackTrace() .

Usage

From source file:com.example.spring.util.SpringBeanFactory.java

/**
 * Returns a spring configured object given an id.
 *
 * @param id//from   ww w. j  av  a2  s . c o  m
 * @return Object, client needs to cast it to appropriate type.
 */
public Object getBean(String id) {
    Object context = new Object();
    try {
        context = applicationContext.getBean(id);
    } catch (BeansException ex) {
        System.out.println(ex.getStackTrace());
    }
    return context;
}

From source file:com.zigbee.framework.common.util.BeanCopyUtil.java

/**
 * Bean Copy Method/*from ww w. ja v a2  s  .c  o  m*/
 * @param srcBean source bean instance
 * @param destBean destination bean instance
 * @throws AppException Application Exception
 */
public static void beanCopy(Object srcBean, Object destBean) throws AppException {

    try {
        BeanUtils.copyProperties(srcBean, destBean);
    } catch (BeansException e) {
        e.printStackTrace();
        String errMsg = "BEAN COPY Exception!" + e.getMessage() + e.getStackTrace();
        throw new AppException(CommonErrorConstants.BEAN_COPY_EXCEPTION, errMsg, e.getCause());

    }

}