Package bitronix.tm.utils

Examples of bitronix.tm.utils.InitializationException


                if (fis != null) fis.close();
            }

            return initXAResourceProducers(properties);
        } catch (IOException ex) {
            throw new InitializationException("cannot create resource loader", ex);
        }
    }
View Full Code Here


            else {
                try {
                    Class clazz = ClassLoaderUtils.loadClass(configuredJounal);
                    journal = (Journal) clazz.newInstance();
                } catch (Exception ex) {
                    throw new InitializationException("invalid journal implementation '" + configuredJounal + "'", ex);
                }
            }
            if (log.isDebugEnabled()) log.debug("using journal " + configuredJounal);
        }
        return journal;
View Full Code Here

            } else {
                try {
                    Class<?> clazz = ClassLoaderUtils.loadClass(configuredJournal);
                    journal = (Journal) clazz.newInstance();
                } catch (Exception ex) {
                    throw new InitializationException("invalid journal implementation '" + configuredJournal + "'", ex);
                }
            }
            if (log.isDebugEnabled()) { log.debug("using journal " + configuredJournal); }

            if (!journalRef.compareAndSet(null, journal)) {
View Full Code Here

            TransactionManagerServices.getResourceLoader().init();
            TransactionManagerServices.getRecoverer().run();

            int backgroundRecoveryInterval = TransactionManagerServices.getConfiguration().getBackgroundRecoveryIntervalSeconds();
            if (backgroundRecoveryInterval < 1) {
                throw new InitializationException("invalid configuration value for backgroundRecoveryIntervalSeconds, found '" + backgroundRecoveryInterval + "' but it must be greater than 0");
            }

            inFlightTransactions = createInFlightTransactionsMap();

            if (log.isDebugEnabled()) { log.debug("recovery will run in the background every " + backgroundRecoveryInterval + " second(s)"); }
            Date nextExecutionDate = new Date(MonotonicClock.currentTimeMillis() + (backgroundRecoveryInterval * 1000L));
            TransactionManagerServices.getTaskScheduler().scheduleRecovery(TransactionManagerServices.getRecoverer(), nextExecutionDate);
        } catch (IOException ex) {
            throw new InitializationException("cannot open disk journal", ex);
        } catch (Exception ex) {
            TransactionManagerServices.getJournal().shutdown();
            TransactionManagerServices.getResourceLoader().shutdown();
            throw new InitializationException("initialization failed, cannot safely start the transaction manager", ex);
        }
    }
View Full Code Here

                if (fis != null) fis.close();
            }

            return initXAResourceProducers(properties);
        } catch (IOException ex) {
            throw new InitializationException("cannot create resource loader", ex);
        }
    }
View Full Code Here

            allowMultipleLrc = getBoolean(properties, "bitronix.tm.allowMultipleLrc", false);
            resourceConfigurationFilename = getString(properties, "bitronix.tm.resource.configuration", null);
            conservativeJournaling = getBoolean(properties, "bitronix.tm.conservativeJournaling", false);
            jdbcProxyFactoryClass = getString(properties, "bitronix.tm.jdbcProxyFactoryClass", "auto");
        } catch (IOException ex) {
            throw new InitializationException("error loading configuration", ex);
        }
    }
View Full Code Here

        URI btmConfig = URI.create(configArea + btmPropFile);
        File cfgFile = new File(btmConfig);
        if (!cfgFile.exists()) {
          cfgFile = new File(btmPropFile);
          if (!cfgFile.exists()) {
            throw new InitializationException("Configuration file not found: " + btmPropFile);
          }
        }

        FileReader fileReader = new FileReader(cfgFile);
        Properties btmProperties = new Properties();
        try {
          btmProperties.load(fileReader);
        }
        finally {
          fileReader.close();
        }

        System.setProperty("bitronix.tm.configuration", cfgFile.getAbsolutePath());

        File resourceFile = cfgFile;
        String resourcePropFile = btmProperties.getProperty("bitronix.tm.resource.configuration");
        if (resourcePropFile != null) {
          URI resourceConfig = URI.create(configArea + resourcePropFile);
          resourceFile = new File(resourceConfig);
            if (!resourceFile.exists()) {
              resourceFile = new File(resourcePropFile);
              if (!resourceFile.exists()) {
                throw new InitializationException("Configuration file not found: " + resourcePropFile);
              }
            }
            System.setProperty("bitronix.tm.resource.configuration", resourceFile.getAbsolutePath());
        }
View Full Code Here

        URI btmConfig = URI.create(configArea + btmPropFile);
        File cfgFile = new File(btmConfig);
        if (!cfgFile.exists()) {
          cfgFile = new File(btmPropFile);
          if (!cfgFile.exists()) {
            throw new InitializationException("Configuration file not found: " + btmPropFile);
          }
        }

        FileReader fileReader = new FileReader(cfgFile);
        Properties btmProperties = new Properties();
        try {
          btmProperties.load(fileReader);
        }
        finally {
          fileReader.close();
        }

        System.setProperty("bitronix.tm.configuration", cfgFile.getAbsolutePath());

        File resourceFile = cfgFile;
        String resourcePropFile = btmProperties.getProperty("bitronix.tm.resource.configuration");
        if (resourcePropFile != null) {
          URI resourceConfig = URI.create(configArea + resourcePropFile);
          resourceFile = new File(resourceConfig);
            if (!resourceFile.exists()) {
              resourceFile = new File(resourcePropFile);
              if (!resourceFile.exists()) {
                throw new InitializationException("Configuration file not found: " + resourcePropFile);
              }
            }
            System.setProperty("bitronix.tm.resource.configuration", resourceFile.getAbsolutePath());
        }
View Full Code Here

TOP

Related Classes of bitronix.tm.utils.InitializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.