Examples of DeployerException


Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

            // invoke setters
            // for the URL of the war file
            try {
                invoke(this.setWarMethod, webAppContext, war.getArchive().getURL().getPath());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get URL from the archive '" + war.getArchive() + "'.", e);
            }
            // for defining the name of the context
            invoke(this.setContextPathMethod, webAppContext, "/" + war.getContextRoot());

            // Java delegation model = true
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

     * @param deployable the deployable that needs to be deployed
     * @throws DeployerException if this deployable is not supported.
     */
    private void checkSupportedDeployable(final IDeployable deployable) throws DeployerException {
        if (!(deployable instanceof EARDeployable || deployable instanceof EJBDeployable)) {
            throw new DeployerException("The deployable '" + deployable + "' is not supported by this deployer");
        }
    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

            }
        }

        // Context not found
        if (context == null) {
            throw new DeployerException("Unable to find a context with the name '" + contextRoot
                    + "' for the War deployable '" + warDeployable + "'.");
        }

        // Stop the context
        invoke(this.stopContextMethod, context);
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

    public static void setContextEvent(final ServletContextEvent contextEvent) throws DeployerException {

        // First, try to get the source on the given context event
        Object source = contextEvent.getSource();
        if (source == null) {
            throw new DeployerException("No source object on the given contextEvent '" + contextEvent + "'.");
        }

        // try to get getContextHandler method on this source object
        Method getContextHandlerMethod = getMethod(source.getClass(), "getContextHandler");
        if (getContextHandlerMethod == null) {
            throw new DeployerException("No getContextHandler method was found on the '" + source + "' object");
        }

        // get Handler
        Object contextHandler = invoke(getContextHandlerMethod, source);
        if (contextHandler == null) {
            throw new DeployerException("No context handler object was returned from the '" + source + "' object");
        }

        // get the getServer method
        Method getServerMethod = getMethod(contextHandler.getClass(), "getServer");
        if (getServerMethod == null) {
            throw new DeployerException("No getServer method was found on the '" + contextHandler + "' object");
        }

        // Set the jetty server
        jettyServer = invoke(getServerMethod, contextHandler);

        // No server ?
        if (jettyServer == null) {
            throw new DeployerException("No Jetty server found on the servlet context event '" + contextEvent + "'.");
        }

    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

        List<URL> urls = new ArrayList<URL>();
        for (EJBDeployable<?> ejb : ejbs) {
            try {
                urls.add(ejb.getArchive().getURL());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get the URL for the Archive '" + ejb.getArchive() + "'.", e);
            }
        }
        for (LibDeployable lib : libs) {
            try {
                urls.add(lib.getArchive().getURL());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get the URL for the Archive '" + lib.getArchive() + "'.", e);

            }
        }

        // Create classloader with these URLs
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

        EZBContainer container = getEmbedded().createContainer(ejbDeployable);
        try {
            container.start();
        } catch (EZBContainerException e) {
            getEmbedded().removeContainer(container);
            throw new DeployerException("Cannot deploy the given EJB '" + ejbDeployable + "'.", e);
        }
    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

     */
    protected static Object newInstance(final Class clazz) throws DeployerException {
        try {
            return clazz.newInstance();
        } catch (InstantiationException e) {
            throw new DeployerException("Cannot make an instance of the class '" + clazz + "'.", e);
        } catch (IllegalAccessException e) {
           throw new DeployerException("Cannot make an instance of the class '" + clazz + "'.", e);
        }
    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

    protected static Object newInstance(final Constructor constructor, final Object... parameters)
            throws DeployerException {
        try {
            return constructor.newInstance(parameters);
        } catch (IllegalArgumentException e) {
            throw new DeployerException("Cannot create a classloader with constructor '" + constructor + "'", e);
        } catch (InstantiationException e) {
            throw new DeployerException("Cannot create a classloader with constructor '" + constructor + "'", e);
        } catch (IllegalAccessException e) {
            throw new DeployerException("Cannot create a classloader with constructor '" + constructor + "'", e);
        } catch (InvocationTargetException e) {
            throw new DeployerException("Cannot create a classloader with constructor '" + constructor + "'", e);
        }
    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

                clazz = classLoader.loadClass(className);
            } else {
                clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
            }
        } catch (ClassNotFoundException e) {
            throw new DeployerException("Cannot load the class '" + className + "'", e);
        }
        return clazz;
    }
View Full Code Here

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException

     */
    protected static Object invoke(final Method method, final Object object, final Object... args) throws DeployerException {
        try {
            return method.invoke(object, args);
        } catch (IllegalArgumentException e) {
            throw new DeployerException("Cannot invoke the method '" + method + "'", e);
        } catch (IllegalAccessException e) {
            throw new DeployerException("Cannot invoke the method '" + method + "'", e);
        } catch (InvocationTargetException e) {
            throw new DeployerException("Cannot invoke the method '" + method + "'", e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.