Package org.glassfish.deployment.common

Examples of org.glassfish.deployment.common.DeploymentException


            wsejbEndpointRegistry = Globals.getDefaultHabitat().getService(
                    WSEjbEndpointRegistry.class);
            if (wsejbEndpointRegistry != null ) {
                wsejbEndpointRegistry.registerEndpoint(webServiceEndpoint,endpointFacade,servant,tieClass);
            } else {
                throw new DeploymentException(localStrings.getLocalString(
                    "ejb.no_webservices_module",
                    "EJB-based Webservice endpoint is detected but there is no webservices module installed to handle it"));
            }
        }
View Full Code Here


                        bootstrap.shutdown();
                    } finally {
                        // ignore.
                    }
                    String msgPrefix = getDeploymentErrorMsgPrefix( t );
                    DeploymentException de = new DeploymentException(msgPrefix + t.getMessage());
                    de.initCause(t);
                    throw(de);
                } finally {
                    invocationManager.popAppEnvironment();
                   
                    //The TCL is originally the EAR classloader
                    //and is reset during Bean deployment to the
                    //corresponding module classloader in BeanDeploymentArchiveImpl.getBeans
                    //for Bean classloading to succeed. The TCL is reset
                    //to its old value here.
                    Thread.currentThread().setContextClassLoader(oldTCL);
                }
            }
        } else if ( event.is(org.glassfish.internal.deployment.Deployment.APPLICATION_STARTED) ) {
            ApplicationInfo appInfo = (ApplicationInfo)event.hook();
            WeldBootstrap bootstrap = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP,
                WeldBootstrap.class);
            if( bootstrap != null ) {
                final String fAppName = appInfo.getName();
                invocationManager.pushAppEnvironment(new ApplicationEnvironment() {

                    @Override
                    public String getName() {
                        return fAppName;
                    }
                   
                });
               
                try {
                    bootstrap.validateBeans();
                    bootstrap.endInitialization();
                } catch (Throwable t) {
                    try {
                        bootstrap.shutdown();
                    } finally {
                        // ignore.
                    }
                    String msgPrefix = getDeploymentErrorMsgPrefix( t );
                    DeploymentException de = new DeploymentException( msgPrefix + t.getMessage());
                    de.initCause(t);
                    throw(de);
                }
                finally {
                    invocationManager.popAppEnvironment();
                }
View Full Code Here

                                // EM creation also triggers DDL generation by provider.
                                em = emf.createEntityManager();
                            } catch (PersistenceException e) {
                                // Exception indicates something went wrong while performing validation. Clean up and rethrow to fail deployment
                                emf.close();
                                throw new DeploymentException(e)// Need to wrap exception in DeploymentException else deployment will not fail !!
                            } finally {
                                if (em != null) {
                                    em.close();
                                }
                            }
View Full Code Here

                } else {
                    JAXRPCCodeGenFacade facade= habitat.getService(JAXRPCCodeGenFacade.class);
                    if (facade != null) {
                        facade.run(habitat, dc, moduleCP, false);
                    else {
                        throw new DeploymentException(rb.getString(LogUtils.JAXRPC_CODEGEN_FAIL)) ;
                    }
                }
            }
            doWebServicesDeployment(app,dc);
            Thread.currentThread().setContextClassLoader(oldCl);
View Full Code Here

            // If wsdl file is an http URL, download that WSDL and all embedded relative wsdls, schemas
            if (ws.getWsdlFileUri().startsWith("http")) {
                try {
                    wsdlFileUri = downloadWsdlsAndSchemas( new URL(ws.getWsdlFileUri()), wsdlDir);
                } catch(Exception e) {
                    throw new DeploymentException(e.toString(), e);
                }
                wsdlFile = new File(wsdlDir, wsdlFileUri);
            } else {
                wsdlFileUri = ws.getWsdlFileUri();
                File wsdlFileAbs = new File(wsdlFileUri);
                wsdlFile = wsdlFileAbs.isAbsolute()? wsdlFileAbs : new File(moduleDir, wsdlFileUri);
            }

            if (!wsdlFile.exists()) {
                String errorMessage = format(logger.getResourceBundle().getString(LogUtils.WSDL_NOT_FOUND),
                        ws.getWsdlFileUri(), bundle.getModuleDescriptor().getArchiveUri());
                logger.log(Level.SEVERE, errorMessage);
                throw new DeploymentException(errorMessage);
            }
        }
    }
View Full Code Here

                // For entries with relative paths, Entity resolver always
                // return file://<absolute path
                if(mappedEntry.startsWith("file:")) {
                    File f = new File(mappedEntry.substring(mappedEntry.indexOf(":")+1));
                    if(!f.exists()) {
                        throw new DeploymentException(format(rb.getString(LogUtils.CATALOG_RESOLVER_ERROR), mappedEntry));
                    }
                    retVal = f.toURI().toURL();
                    if(ws != null) {
                        ws.setWsdlFileUri(f.getAbsolutePath());
                        ws.setWsdlFileUrl(retVal);
                    }
                } else if(mappedEntry.startsWith("http")) {
                    retVal = new URL(mappedEntry);
                    if(ws != null) {
                        ws.setWsdlFileUrl(retVal);
                    }
                }
            }
            return retVal;

        } catch (Throwable t) {
            throw new DeploymentException(format(rb.getString(LogUtils.CATALOG_ERROR),
                     catalogFile.getAbsolutePath(), t.getMessage()));
        }
     
    }
View Full Code Here

        for(WebServiceEndpoint nextEndpoint : endpoints) {
            WebComponentDescriptor webComp = nextEndpoint.getWebComponentImpl();

            if( !nextEndpoint.hasServletImplClass() ) {
                throw new DeploymentException( format(rb.getString(
                        LogUtils.DEPLOYMENT_BACKEND_CANNOT_FIND_SERVLET),
                        nextEndpoint.getEndpointName()));
            }

            if (nextEndpoint.hasEndpointAddressUri()) {
                webComp.getUrlPatternsSet().clear();
                webComp.addUrlPattern(nextEndpoint.getEndpointAddressUri());
            }

            if( !nextEndpoint.getWebService().hasFilePublishing() ) {
                String publishingUri = nextEndpoint.getPublishingUri();
                String publishingUrlPattern =
                        (publishingUri.charAt(0) == '/') ?publishingUri : "/" + publishingUri + "/*";
                webComp.addUrlPattern(publishingUrlPattern);

            }

            String servletImplClass = nextEndpoint.getServletImplClass();
            try {
                Class servletImplClazz  = cl.loadClass(servletImplClass);
                String containerServlet;
                if(wsutil.isJAXWSbasedService(nextEndpoint.getWebService())) {
                    containerServlet = "org.glassfish.webservices.JAXWSServlet";
                    addWSServletContextListener(webBunDesc);
                } else {
                    containerServlet =
                    SingleThreadModel.class.isAssignableFrom(servletImplClazz) ?
                    "org.glassfish.webservices.SingleThreadJAXRPCServlet" :
                        "org.glassfish.webservices.JAXRPCServlet";
                }
                webComp.setWebComponentImplementation(containerServlet);

            } catch(ClassNotFoundException cex) {
                throw new DeploymentException( format(rb.getString(
                        LogUtils.DEPLOYMENT_BACKEND_CANNOT_FIND_SERVLET),
                        nextEndpoint.getEndpointName()));
            }

            /**
 
View Full Code Here

        if( generateRmicStubs ) {
            StaticRmiStubGenerator staticStubGenerator = new StaticRmiStubGenerator(habitat);
            try {
                staticStubGenerator.ejbc(dc);
            } catch(Exception e) {
                throw new DeploymentException("Static RMI-IIOP Stub Generation exception for " +
                        dc.getSourceDir(), e);
            }
        }

        if (bundle == null || !bundle.containsCMPEntity()) {
            // bundle WAS null in a war file where we do not support CMPs
            return;
        }

        initCMPDeployer();
        if (cmpDeployer == null) {
            throw new DeploymentException("No CMP Deployer is available to deploy this module");
        }
        cmpDeployer.deploy(dc);  


    }
View Full Code Here

            } else {
                throw new RuntimeException("EJB Timer Service is not available");
           

        } catch (Exception e) {
            throw new DeploymentException("Failed to create automatic timers for " + ejbDescriptor.getName(), e);
       
    }
View Full Code Here

                    dc.getScratchDir("xml").getParentFile(),
                    generatedEARFacadeName(application.getAppName()),
                        appClientGroupListSB.toString());
            recordGroupFacadeGeneration();
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.deployment.common.DeploymentException

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.