Example usage for org.springframework.beans BeansException printStackTrace

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

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:inc.cygnus.app.MainSpring.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                // Implementasi Konfigurasi Spring framework
                @SuppressWarnings("resource")
                ApplicationContext appContext = new ClassPathXmlApplicationContext("applicationContext.xml");

                // Initialize service
                setCustomerService((CustomerService) appContext.getBean("customerService"));
                setProductService((ProductService) appContext.getBean("productService"));
                setPurchaseService((PurchaseService) appContext.getBean("purchaseService"));

                try {
                    // After finish service initialize
                    // Show Form Menu Master
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(MainSpring.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(MainSpring.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(MainSpring.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(MainSpring.class.getName()).log(Level.SEVERE, null, ex);
                }/*  w w w  . j ava 2  s . co m*/
                Menu mmv = new Menu();

                mmv.setVisible(true);

            } catch (BeansException e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:org.guicerecipes.spring.converter.SpringConverter.java

public static void main(String[] args) {
    if (args.length == 0) {
        System.out.println("Usage: springXmlFile [outputDirectory] [outputClassName]");
    } else {//from w  w  w.  j  av  a2  s .  c  o  m
        String springFile = args[0];
        XmlBeanFactory beanFactory = null;
        try {
            beanFactory = new XmlBeanFactory(new FileSystemResource(springFile));
        } catch (BeansException e) {
            System.out.println("Failed to open: " + springFile + ". Reason: " + e);
            e.printStackTrace();
            return;
        }
        try {
            SpringConverter converter = new SpringConverter(beanFactory);
            converter.convert();
        } catch (Exception e) {
            System.out.println("Failed to file from: " + springFile);
            System.out.println(e);
            e.printStackTrace();
        }
    }
}

From source file:org.metis.cassandra.SimpleContextTest.java

@BeforeClass
public static void initialize() throws Exception {
    try {/*from w  ww. jav  a  2  s  .  c om*/
        cc = CqlComponent.cqlComponent("cassandra.xml");
    } catch (BeansException be) {
        System.out.println(
                "ERROR: unable to load spring context, got " + "this exception: \n" + be.getLocalizedMessage());
        be.printStackTrace();
    }
}

From source file:org.web4thejob.context.ContextUtil.java

public static Panel getPanelSafe(String id) {
    try {//from  w  ww  . j  a  va 2  s .co  m
        return getSessionContext().getBean(id, Panel.class);
    } catch (BeansException e) {
        e.printStackTrace();
    }
    return null;
}

From source file:org.metis.cassandra.CqlStmntTest.java

/**
 * To run these tests, Cassandra needs to be running and the videodb
 * keyspace must be installed. See ${project-home}/src/main/cql for videodb
 * CQL scripts/*from  ww w . j a v  a 2s  .co  m*/
 * 
 * @throws Exception
 */
@BeforeClass
public static void initialize() throws Exception {
    // Grab the cluster bean defined in the test cassandra.xml file.
    try {
        context = new ClassPathXmlApplicationContext("cassandra.xml");
    } catch (BeansException be) {
        System.out.println(
                "ERROR: unable to load spring context, got this exception: \n" + be.getLocalizedMessage());
        be.printStackTrace();
    }
    clusterBean = context.getBean(ClusterBean.class);
}

From source file:com.hm.SSI.dubbo.DubboProvider.java

@Test
public void testDubboProvider() throws Exception {
    System.in.read();/* w  ww.j ava  2 s  .  c  om*/
    try {
        //new ClassPathXmlApplicationContext("application-RmiService.xml");  
        Object lock = new Object();
        synchronized (lock) {
            lock.wait();
        }
    } catch (BeansException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:base.UnitTestBase.java

protected <T extends Object> T getBean(Class<T> clazz) {
    try {/*from   w w w  .jav  a  2s.c  o  m*/
        return context.getBean(clazz);
    } catch (BeansException e) {
        e.printStackTrace();
        return null;
    }
}

From source file:base.UnitTestBase.java

@SuppressWarnings("unchecked")
protected <T extends Object> T getBean(String beanId) {
    try {//www  .  j av a 2s.com
        return (T) context.getBean(beanId);
    } catch (BeansException e) {
        e.printStackTrace();
        return null;
    }
}

From source file:base.UnitTestBase.java

@Before
public void before() {
    if (StringUtils.isEmpty(springXmlpath)) {
        springXmlpath = "classpath:/springConfig/applicationContext.xml";
    }/*w w w.  j a  v a  2s  . c o m*/
    try {
        context = new ClassPathXmlApplicationContext(springXmlpath.split("[,\\s]+"));
        context.start();
    } catch (BeansException e) {
        e.printStackTrace();
    }
}

From source file:com.mycomm.dao.mydao.UserDaoTest.java

public void userInit() throws Exception {
    try {/*from   w w  w.jav  a2  s  .c  om*/
        IUserDao userDao = (IUserDao) applicationContext.getBean("userDaoImpl");
        if (userDao != null) {
            userDao.init();
        }
    } catch (BeansException e) {
        e.printStackTrace();
    }
}