Package com.sun.enterprise.deployment.backend

Examples of com.sun.enterprise.deployment.backend.IASDeploymentException


                ApplicationConfigHelper.checkContextRootUniqueness(
                    DeploymentServiceUtils.getConfigContext(), req.getName(),
                    req.getTarget().getName(), virtualServers);
            if (contextRootInConflict != null) {
                throw new IASDeploymentException(localStrings.getString(
                    "duplicate_context_root",
                    contextRootInConflict, req.getName(),
                    req.getTarget().getName()));
            }

            // only support directory deployment on DAS
            if (DeploymentServiceUtils.isDirectoryDeployed(req.getName(),
                req.getType())) {
                if (target != null && ServerHelper.isAServer(deploymentCtx.getConfigContext(), target.getTarget().getName()) && ServerHelper.isDAS(deploymentCtx.getConfigContext(), target.getTarget().getName())) {
                    return;
                } else {
                    throw new IASDeploymentException(localStrings.getString(
                        "dir_deploy_not_support"));
                }
            }

            // FIXME: add the context root check here
View Full Code Here


               while(fileSetIter.hasNext()) {
                   cp+=(File.pathSeparator+((File)fileSetIter.next()).getAbsolutePath());
               }
           }
        } catch (IOException ioex) {
            throw new IASDeploymentException("IOException : " + ioex.getMessage() +
                    " when trying to get list of files under " + dirName);
        }       
        return cp;
    }
View Full Code Here

                        classpath+=(File.pathSeparator+givenCP);
                    }
                }
            }
        } catch (Exception e) {
            throw new IASDeploymentException("Exception : " + e.getMessage() +
                    " when trying to process MANIFEST file under " + moduleDir);           
        } finally {
            if(is != null) {
                try {
                    is.close();
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 {
                            downloadWsdlsAndSchemas(ws, new URL(ws.getWsdlFileUri()), wsdlDir);                                               
                        } catch(Exception e) {
                            throw new IASDeploymentException(e.toString(), e);
                        }
                        wsdlFileUri = ws.getWsdlFileUri().substring(ws.getWsdlFileUri().lastIndexOf("/")+1);
                        wsdlFile = new File(wsdlDir, wsdlFileUri);
                       
                        // at this point, we don't care we got it from and it simplifies
                        // the rest of the deployment process to just think that is was
                        // generated during deployment
                        // ws.setWsdlFileUri(null);
                   
                    } else {
                        wsdlFileUri = ws.getWsdlFileUri();                       
                        if(wsdlFileUri.startsWith("/")) {
                            wsdlFile = new File(wsdlFileUri);    
                        } else {
                            wsdlFile = new File(moduleDir, wsdlFileUri);    
                        }
                        if (!wsdlFile.exists()) {
                            throw new IASDeploymentException("WebService " + ws.getName() + " wsdl file "
                                    + ws.getWsdlFileUri() + " not found in archive "
                                    + bundle.getModuleDescriptor().getArchiveUri());
                        }
                    }

                } else {
                    //make required dirs in case they are not present
                    wsdlFileUri = JAXBRIContext.mangleNameToClassName(ws.getName()) + ".wsdl";  
                    wsdlDir.mkdirs();
                    wsdlFile = new File(wsdlDir, wsdlFileUri);                   
                }
                for (WebServiceEndpoint endpoint : ws.getEndpoints()) {

                    String implClassName;
                    boolean jaxwsEndPtFound = false;
                    boolean jaxrpcEndPtFound = false;
                    if (endpoint.implementedByEjbComponent()) {
                        implClassName = endpoint.getEjbComponentImpl().getEjbClassName();
                    } else {
                        implClassName = endpoint.getWebComponentImpl().getWebComponentImplementation();
                    }
                   
                    // check this is NOT a provider interface
                    Class implClass;
                    try {
                        implClass = app.getClassLoader().loadClass(implClassName);
                    } catch(Exception e) {
                            throw new IASDeploymentException("WebService " + ws.getName() + "implementation "
                                    + implClassName + " not found in archive "
                                    + bundle.getModuleDescriptor().getArchiveUri());                       
                    }
                   
                    if (implClass!=null) {
                        if(implClass.getAnnotation(javax.xml.ws.WebServiceProvider.class) != null) {
                            // if we already found a jaxrpcendpoint, flag error since we do not support jaxws+jaxrpc endpoint
                            // in the same service
                            if(jaxrpcEndPtFound) {
                                throw new IASDeploymentException("WebService " + ws.getName() +
                                        "has a JAXWS and a JAXRPC endpoint; this is not supported now");
                            }
                            //This is a JAXWS endpoint with @WebServiceProvider
                            //Do not run wsgen for this endpoint
                            jaxwsEndPtFound = true;
                            continue;
                        }
                        if(implClass.getAnnotation(javax.jws.WebService.class) != null) {
                   
                            // if we already found a jaxrpcendpoint, flag error since we do not support jaxws+jaxrpc endpoint
                            // in the same service
                            if(jaxrpcEndPtFound) {
                                throw new IASDeploymentException("WebService " + ws.getName() +
                                        "has a JAXWS and a JAXRPC endpoint; this is not supported now");
                            }
                            // This is a JAXWS endpoint with @WebService; Invoke wsgen
                            jaxwsEndPtFound = true;
                            String wsgenClassPath = getWsgenClassPath(classesDir, webinfLibDir,
                                request.getDeployedDirectory().getAbsolutePath()+File.separator+app.getLibraryDirectory(),
                                moduleDir.getAbsolutePath(),app);
                            boolean wsgenDone =
                                runWsGen(implClassName, wsdlFile.exists(), wsgenClassPath,
                                    stubsDir, wsdlDir, endpoint.getServiceName(), endpoint.getWsdlPort());
                            if(!wsgenDone) {
                                // wsgen failed; if WSDL file were present, just throw a warning
                                // assuming that the user would have packaged everything
                                if(!wsdlFile.exists()) {
                                    throw new IASDeploymentException("WSGEN FAILED");
                                } else {
                                    logger.log(Level.WARNING,
                                        "wsgen failed - proceeding under the assumption that the user packaged all required objects properly");
                                }
                            }
                            try {
                                endpoint.getWebService().setWsdlFileUrl(wsdlFile.toURI().toURL());
                            } catch(java.net.MalformedURLException mue) {
                                throw new IASDeploymentException("WSGEN Failed");
                            }
                            logger.log(Level.INFO, "wsgen successful");
                        } else {
                            // this is a jaxrpc endpoint
                            // if we already found a jaxws endpoint, flag error since we do not support jaxws+jaxrpc endpoint
                            // in the same service
                            if(jaxwsEndPtFound) {
                                throw new IASDeploymentException("WebService " + ws.getName() +
                                        "has a JAXWS and a JAXRPC endpoint; this is not supported now");
                            }
                            // Set spec version to 1.1 to indicate later the wscompile should be run
                            // We do this here so that jaxrpc endpoint having J2EE1.4 or JavaEE5
                            // descriptors will work properly
View Full Code Here

        } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
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 IASDeploymentException("File " + mappedEntry + " not found");
                    }
                    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 IASDeploymentException("Exception while processing catalog "
                    + catalogFile.getAbsolutePath() + "; Reason " + t.getMessage());
        }       
   
    }
View Full Code Here

        } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

        } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
               throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

        } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

       } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.backend.IASDeploymentException

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.