Package org.glassfish.embeddable

Examples of org.glassfish.embeddable.GlassFishException


        ApplicationInfo appInfo = deployment.get(name);

        if (appInfo == null) {
            report.setMessage("Cannot find deployed application of name " + name);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot find deployed application of name " + name);
        }

        ReadableArchive source = appInfo.getSource();

        if (source == null) {
            report.setMessage("Cannot get source archive for undeployment");
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot get source archive for undeployment");
        }

        UndeployCommandParameters params = new UndeployCommandParameters(name);
        params.origin = UndeployCommandParameters.Origin.undeploy;
        params.target = "server";
        ExtendedDeploymentContext deploymentContext = null;

        try {
            deploymentContext = deployment.getBuilder(_logger, params, report).source(source).build();
            deployment.undeploy(name, deploymentContext);
            deployment.unregisterAppFromDomainXML(name, "server");
        } catch (IOException e) {
            _logger.log(Level.SEVERE, REMOVE_CONTEXT_ERROR, e);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot create context for undeployment ", e);
        } catch (TransactionFailure e) {
            throw new GlassFishException(e);
        } finally {
            if (deploymentContext!=null) {
                deploymentContext.clean();
            }
        }
View Full Code Here


                    if (log.isLoggable(Level.INFO)) {
                        log.info("Removed context with path " + contextRoot +
                                " from virtual server " + vs.getID());
                    }
                } else {
                    throw new GlassFishException("Context with context path " +
                            context.getPath() + " does not exist on virtual server " + vs.getID());
                }
            }
        }
View Full Code Here

        throws GlassFishException {

        if (listeners.contains(webListener)) {
            listeners.remove(webListener);
        } else {
            throw new GlassFishException(new ConfigException(
                    "Connector with name '" + webListener.getId()+"' does not exsits"));
        }

        removeListener(webListener.getId());
View Full Code Here

                    param.getVirtualServer().add(newVirtualServer);
                    return newVirtualServer;
                }
            }, httpService);
        } catch (Exception ex) {
            throw new GlassFishException(ex);
        }

        if ((webListeners != null) && (!webListeners.isEmpty())) {
            for (WebListener listener : webListeners) {
                if (getWebListener(listener.getId())==null) {
                    addWebListener(listener, virtualServer.getID());
                }
            }
        }

        vs = (com.sun.enterprise.web.VirtualServer) engine.findChild(id);
        if (vs != null) {
            if (log.isLoggable(Level.INFO)) {
                log.info("Added virtual server " + id +
                        " docroot " + docRoot + " networklisteners " + nl);
            }
            if (virtualServer instanceof VirtualServerFacade) {
                ((VirtualServerFacade)virtualServer).setVirtualServer(vs);
            }
            vs.setNetworkListenerNames(names.toArray(new String[names.size()]));
        } else {
            log.severe("Could not add virtual server "+id);
            throw new GlassFishException(
                    new Exception("Cannot add virtual server " + id));

        }
       
    }
View Full Code Here

            gfMap.put(gfProps.getInstanceRoot(), gfImpl);
            return gfImpl;
        } catch (GlassFishException e) {
            throw e;
        } catch(Exception e) {
            throw new GlassFishException(e);
        }
    }
View Full Code Here

        } catch (Exception ex) {
            if (deployment!=null && deploymentContext!=null) {
                deploymentContext.clean();
            }
            throw new GlassFishException(ex);
        }

    }
View Full Code Here

        ApplicationInfo appInfo = deployment.get(name);

        if (appInfo == null) {
            report.setMessage("Cannot find deployed application of name " + name);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot find deployed application of name " + name);
        }

        ReadableArchive source = appInfo.getSource();

        if (source == null) {
            report.setMessage("Cannot get source archive for undeployment");
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot get source archive for undeployment");
        }

        UndeployCommandParameters params = new UndeployCommandParameters(name);
        params.origin = UndeployCommandParameters.Origin.undeploy;
        params.target = "server";
        ExtendedDeploymentContext deploymentContext = null;

        try {
            deploymentContext = deployment.getBuilder(_logger, params, report).source(source).build();
            deployment.undeploy(name, deploymentContext);
            deployment.unregisterAppFromDomainXML(name, "server");
        } catch (IOException e) {
            _logger.log(Level.SEVERE, REMOVE_CONTEXT_ERROR, e);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            throw new GlassFishException("Cannot create context for undeployment ", e);
        } catch (TransactionFailure e) {
            throw new GlassFishException(e);
        } finally {
            if (deploymentContext!=null) {
                deploymentContext.clean();
            }
        }
View Full Code Here

TOP

Related Classes of org.glassfish.embeddable.GlassFishException

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.