Example usage for java.lang ExceptionInInitializerError fillInStackTrace

List of usage examples for java.lang ExceptionInInitializerError fillInStackTrace

Introduction

In this page you can find the example usage for java.lang ExceptionInInitializerError fillInStackTrace.

Prototype

public synchronized Throwable fillInStackTrace() 

Source Link

Document

Fills in the execution stack trace.

Usage

From source file:uk.nhs.cfh.dsp.srth.simulator.impl.DataGenerationEngineFactoryImpl.java

public void recreateDatabase() {
    try {//ww  w  . j  a  v  a2  s  .c om
        //            Map<String, String> connectionMap = new HashMap<String, String>();
        //            connectionMap.put("hibernate.hbm2ddl.auto", "update");
        //            EntityManagerFactory emf = Persistence.createEntityManagerFactory("simulatorjpa", connectionMap);
        //            emf.close();
        logger.info("Starting purge of database...");
        persistenceUnitManager.obtainPersistenceUnitInfo("simulatorjpa");
        logger.info("persistenceUnitManager = " + persistenceUnitManager);
        LocalContainerEntityManagerFactoryBean lemf = new LocalContainerEntityManagerFactoryBean();
        lemf.setPersistenceUnitManager(persistenceUnitManager);
        logger.info("xmlLocation = " + xmlLocation);
        File f = new File(xmlLocation);
        logger.info("f.exists() = " + f.exists());
        logger.info("f.getAbsolutePath() = " + f.getAbsolutePath());
        logger.info("dataSource = " + dataSource);
        //            lemf.setPersistenceXmlLocation(xmlLocation);
        //            lemf.setDataSource(dataSource);
        logger.info("lemf.getPersistenceUnitName() = " + lemf.getPersistenceUnitName());
        lemf.getNativeEntityManagerFactory().close();
        logger.info("Finished recreating database.");
    } catch (ExceptionInInitializerError e) {
        logger.warn("Error recreating database. Nested exception is : " + e.fillInStackTrace());
    }
}