Package org.ofbiz.base.start

Examples of org.ofbiz.base.start.StartupException


        }
        Class<?> containerClass = null;
        try {
            containerClass = loader.loadClass(containerCfg.className);
        } catch (ClassNotFoundException e) {
            throw new StartupException("Cannot locate container class", e);
        }
        if (containerClass == null) {
            throw new StartupException("Component container class not loaded");
        }

        // create a new instance of the container object
        Container containerObj = null;
        try {
            containerObj = (Container) containerClass.newInstance();
        } catch (InstantiationException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (IllegalAccessException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (ClassCastException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        }

        if (containerObj == null) {
            throw new StartupException("Unable to create instance of component container");
        }

        // initialize the container object
        try {
            containerObj.init(args, configFile);
        } catch (ContainerException e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        } catch (java.lang.AbstractMethodError e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        }

        return containerObj;
    }
View Full Code Here


                return;
            }
            try {
                container.start();
            } catch (ContainerException e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            } catch (java.lang.AbstractMethodError e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            }
        }
    }
View Full Code Here

        Collection<ContainerConfig.Container> containers = null;
        try {
            containers = ContainerConfig.getContainers(configFile);
        } catch (ContainerException e) {
            throw new StartupException(e);
        }

        if (containers != null) {
            for (ContainerConfig.Container containerCfg: containers) {
                Container tmpContainer = loadContainer(containerCfg, args);
                loadedContainers.add(tmpContainer);

                // This is only used in case of OFBiz running in Geronimo or WASCE. It allows to use the RMIDispatcher
                if (containerCfg.name.equals("rmi-dispatcher") && configFile.equals("limited-containers.xml")) {
                    try {
                        ContainerConfig.Container.Property initialCtxProp = containerCfg.getProperty("use-initial-context");
                        String useCtx = initialCtxProp == null || initialCtxProp.value == null ? "false" : initialCtxProp.value;
                        if (!useCtx.equalsIgnoreCase("true")) {
                            //system.setProperty("java.security.policy", "client.policy"); maybe used if needed...
                            if (System.getSecurityManager() == null) { // needed by WASCE with a client.policy file.
                                System.setSecurityManager(new java.rmi.RMISecurityManager());
                            }
                            tmpContainer.start();
                            rmiLoadedContainer = tmpContainer; // used in Geronimo/WASCE to allow to deregister
                        }
                    } catch (ContainerException e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    } catch (java.lang.AbstractMethodError e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    }
                }
            }
        }
    }
View Full Code Here

        // start each container object
        for (Container container: loadedContainers) {
            try {
                container.start();
            } catch (ContainerException e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            } catch (java.lang.AbstractMethodError e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            }
        }
    }
View Full Code Here

        }
        Class<?> containerClass = null;
        try {
            containerClass = loader.loadClass(containerCfg.className);
        } catch (ClassNotFoundException e) {
            throw new StartupException("Cannot locate container class", e);
        }
        if (containerClass == null) {
            throw new StartupException("Component container class not loaded");
        }

        // create a new instance of the container object
        Container containerObj = null;
        try {
            containerObj = (Container) containerClass.newInstance();
        } catch (InstantiationException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (IllegalAccessException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (ClassCastException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        }

        if (containerObj == null) {
            throw new StartupException("Unable to create instance of component container");
        }

        // initialize the container object
        try {
            containerObj.init(args, configFile);
        } catch (ContainerException e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        } catch (java.lang.AbstractMethodError e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        }

        return containerObj;
    }
View Full Code Here

        Collection<ContainerConfig.Container> containers = null;
        try {
            containers = ContainerConfig.getContainers(configFile);
        } catch (ContainerException e) {
            throw new StartupException(e);
        }

        if (containers != null) {
            for (ContainerConfig.Container containerCfg: containers) {
                Container tmpContainer = loadContainer(containerCfg, args);
                loadedContainers.add(tmpContainer);

                // This is only used in case of OFBiz running in Geronimo or WASCE. It allows to use the RMIDispatcher
                if (containerCfg.name.equals("rmi-dispatcher") && configFile.equals("limited-containers.xml")) {
                    try {
                        ContainerConfig.Container.Property initialCtxProp = containerCfg.getProperty("use-initial-context");
                        String useCtx = initialCtxProp == null || initialCtxProp.value == null ? "false" : initialCtxProp.value;
                        if (!useCtx.equalsIgnoreCase("true")) {
                            //system.setProperty("java.security.policy", "client.policy"); maybe used if needed...
                            if (System.getSecurityManager() == null) { // needed by WASCE with a client.policy file.
                                System.setSecurityManager(new java.rmi.RMISecurityManager());
                            }
                            tmpContainer.start();
                            rmiLoadedContainer = tmpContainer; // used in Geronimo/WASCE to allow to deregister
                        }
                    } catch (ContainerException e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    } catch (java.lang.AbstractMethodError e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    }
                }
            }
        }
    }
View Full Code Here

        // start each container object
        for (Container container: loadedContainers) {
            try {
                container.start();
            } catch (ContainerException e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            } catch (java.lang.AbstractMethodError e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            }
        }
    }
View Full Code Here

        }
        Class<?> containerClass = null;
        try {
            containerClass = loader.loadClass(containerCfg.className);
        } catch (ClassNotFoundException e) {
            throw new StartupException("Cannot locate container class", e);
        }
        if (containerClass == null) {
            throw new StartupException("Component container class not loaded");
        }

        // create a new instance of the container object
        Container containerObj = null;
        try {
            containerObj = (Container) containerClass.newInstance();
        } catch (InstantiationException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (IllegalAccessException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        } catch (ClassCastException e) {
            throw new StartupException("Cannot create " + containerCfg.name, e);
        }

        if (containerObj == null) {
            throw new StartupException("Unable to create instance of component container");
        }

        // initialize the container object
        try {
            containerObj.init(args, configFile);
        } catch (ContainerException e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        } catch (java.lang.AbstractMethodError e) {
            throw new StartupException("Cannot init() " + containerCfg.name, e);
        }

        return containerObj;
    }
View Full Code Here

       
        Collection<ContainerConfig.Container> containers = null;
        try {
            containers = ContainerConfig.getContainers(configFile);
        } catch (ContainerException e) {           
            throw new StartupException(e);
        }

        if (containers != null) {
            for (ContainerConfig.Container containerCfg: containers) {
                Container tmpContainer = loadContainer(containerCfg, args);
                loadedContainers.add(tmpContainer);

                // This is only used in case of OFBiz running in Geronimo or WASCE. It allows to use the RMIDispatcher
                if (containerCfg.name.equals("rmi-dispatcher") && configFile.equals("limited-containers.xml")) {
                    try {
                        ContainerConfig.Container.Property initialCtxProp = containerCfg.getProperty("use-initial-context");
                        String useCtx = initialCtxProp == null || initialCtxProp.value == null ? "false" : initialCtxProp.value;
                        if (!useCtx.equalsIgnoreCase("true")) {
                            //system.setProperty("java.security.policy", "client.policy"); maybe used if needed...
                            if (System.getSecurityManager() == null) { // needed by WASCE with a client.policy file.
                                System.setSecurityManager(new java.rmi.RMISecurityManager());
                            }
                            tmpContainer.start();
                            rmiLoadedContainer = tmpContainer; // used in Geronimo/WASCE to allow to deregister
                        }
                    } catch (ContainerException e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    } catch (java.lang.AbstractMethodError e) {
                        throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e);
                    }
                }
            }
        }
    }
View Full Code Here

        // start each container object
        for (Container container: loadedContainers) {
            try {
                container.start();
            } catch (ContainerException e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            } catch (java.lang.AbstractMethodError e) {
                throw new StartupException("Cannot start() " + container.getClass().getName(), e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.ofbiz.base.start.StartupException

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.