Package org.ow2.easybeans.component.api

Examples of org.ow2.easybeans.component.api.EZBComponentException


        this.server.setAddress(this.hostname);

        try {
            Class.forName("org.hsqldb.jdbcDriver");
        } catch (ClassNotFoundException e) {
            throw new EZBComponentException("Cannot access to HSQL Driver 'org.hsqldb.jdbcDriver'.", e);
        }

    }
View Full Code Here


            // Maybe strange but 'SHUTDOWN' state seems to be an intermediate
            // state during startup
            retryNb++;
            if (this.server.getState() == ServerConstants.SERVER_STATE_SHUTDOWN && retryNb >= MAX_RETRY_NB) {
                Throwable t = this.server.getServerError();
                throw new EZBComponentException("Cannot start the server. The server has not started and is shutdown.", t);
            }
            logger.debug("retry= {0}, serverState= {1}", retryNb, this.server.getState());
        }

        String connURL = "jdbc:hsqldb:hsql://" + this.hostname + ":" + this.portNumber + "/" + this.databaseName;
        logger.info("{0} started with URL {1}", this.server.getProductName(), connURL);

        Connection conn = null;
        Statement st = null;

        try {
            conn = DriverManager.getConnection(connURL, "sa", "");
        } catch (SQLException e) {
            throw new EZBComponentException("Cannot access to HSQL", e);
        }

        try {
            st = conn.createStatement();
        } catch (SQLException e) {
            try {
                conn.close();
            } catch (SQLException connEx) {
                logger.error("Error while closing connection object", connEx);
            }
            throw new EZBComponentException("Cannot access to HSQL", e);
        }



        // Drop users before recreating it
View Full Code Here

        }

        try {
            ConfigurationRepository.init(carolConf, domainName, "EasyBeans");
        } catch (Exception e) {
            throw new EZBComponentException("Cannot initialize registry", e);
        }

        try {
            ConfigurationRepository.addInterceptors("jrmp", JTAInterceptorInitializer.class);
        } catch (Exception e) {
            throw new EZBComponentException("Cannot add JOTM interceptors", e);
        }

        try {
            ConfigurationRepository.addInterceptors("iiop", "org.objectweb.jotm.ots.OTSORBInitializer");
        } catch (Exception e) {
            throw new EZBComponentException("Cannot add JOTM interceptors", e);
        }

        try {
            ConfigurationRepository.addInterceptors("jrmp", SecurityInitializer.class);
        } catch (Exception e) {
            throw new EZBComponentException("Cannot add Security interceptors", e);
        }

    }
View Full Code Here

        // Start registry only if there are protocols
        if (this.protocols != null && !this.protocols.isEmpty()) {
            try {
                NameServiceManager.getNameServiceManager().startNS();
            } catch (Exception e) {
                throw new EZBComponentException("Cannot start registry", e);
            }
        }

        if (this.keepRunning) {
            this.logger.info("KeepRunning mode enabled");
View Full Code Here

        // Stop registry only if there are protocols
        if (this.protocols != null && !this.protocols.isEmpty()) {
            try {
                NameServiceManager.getNameServiceManager().stopNS();
            } catch (Exception e) {
                throw new EZBComponentException("Cannot stop the registry", e);
            }


            // Unbind all objects that are still in the registry
            NamingEnumeration<NameClassPair> namingEnumeration = null;
            try {
                namingEnumeration = new InitialContext().list("");
            } catch (NamingException e) {
                throw new EZBComponentException("Unable to unbind remaining objects in the registry", e);
            }

            // Loop on all objects
            List<String> names = new ArrayList<String>();
            while (namingEnumeration.hasMoreElements()) {
View Full Code Here

        // Initialize the Quartz scheduler Factory
        schedulerFactory = null;
        try {
            schedulerFactory  = new StdSchedulerFactory(schedulerProperties);
        } catch (SchedulerException e) {
            throw new EZBComponentException("Cannot initialize the Scheduler factory", e);
        }
    }
View Full Code Here

        // Build a Scheduler
        try {
            this.scheduler = schedulerFactory.getScheduler();
        } catch (SchedulerException e) {
            throw new EZBComponentException("Cannot get a scheduler from the factory", e);
        }

        // Start the scheduler
        try {
            scheduler.start();
        } catch (SchedulerException e) {
           throw new EZBComponentException("Cannot start the scheduler", e);
        }
    }
View Full Code Here

    public void stop() throws EZBComponentException {
        // Stop the scheduler
        try {
            scheduler.shutdown();
        } catch (SchedulerException e) {
            throw new EZBComponentException("Cannot stop the scheduler", e);
        }
    }
View Full Code Here

        // Create Transaction manager
        try {
            this.jotm = new Jotm(true, false);
        } catch (NamingException e) {
            throw new EZBComponentException("Cannot init JOTM object", e);
        }

        // Set transaction timeout
        try {
            this.jotm.getTransactionManager().setTransactionTimeout(this.timeout);
        } catch (SystemException se) {
            throw new EZBComponentException("Cannot set Transaction Timeout", se);
        }

        // Bind it
        try {
            new InitialContext().rebind(JNDI_NAME, this.jotm.getTransactionManager());
        } catch (NamingException e) {
            throw new EZBComponentException("Cannot bind user transaction", e);
        }

        // Init the static Transaction manager.
        JTransactionManager.init();
View Full Code Here

        // Unbind user transaction object
        try {
            new InitialContext().unbind(JNDI_NAME);
        } catch (NamingException e) {
            throw new EZBComponentException("Cannot unbind user transaction", e);
        }

        // Stop timer
        TimerManager.stop(true);
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.component.api.EZBComponentException

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.