Package org.apache.geronimo.common

Examples of org.apache.geronimo.common.DeploymentException$CleanseException


        } else if (definition != null) {
            try {
                uri = new URI(definition.getDocumentBaseURI());
                uris.push(uri);
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not locate definition", e);
            }
        } else {
            throw new DeploymentException("You must supply uri or definition");
        }
        if (schemaTypeSystem == null) {
            schemaTypeSystem = compileSchemaTypeSystem(definition);
        }
        this.definition = definition;
View Full Code Here


                    } else if(xmlError.getSeverity() == XmlError.SEVERITY_INFO) {
                        log.debug(xmlError);
                    }
                }
                if (wasError) {
                    throw new DeploymentException("Could not compile schema type system, see log for errors");
                }
            }
            return schemaTypeSystem;
        } catch (XmlException e) {
            throw new DeploymentException("Could not compile schema type system: " + schemaList, e);
        }
    }
View Full Code Here

                    if (definition1 != null) {
                        try {
                            URI uri = new URI(definition1.getDocumentBaseURI());
                            uris.push(uri);
                        } catch (URISyntaxException e) {
                            throw new DeploymentException("Could not locate definition", e);
                        }
                        try {
                            addImportsFromDefinition(definition1, schemaList);
                        } finally {
                            uris.pop();
View Full Code Here

    private void addSchemaElement(Element element, Map namespaceMap, List schemaList) throws DeploymentException {
        try {
            XmlObject xmlObject = parseWithNamespaces(element, namespaceMap);
            schemaList.add(xmlObject);
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse schema element", e);
        }
    }
View Full Code Here

        Definition definition;
        WSDLFactory wsdlFactory;
        try {
            wsdlFactory = WSDLFactory.newInstance();
        } catch (WSDLException e) {
            throw new DeploymentException("Could not create WSDLFactory", e);
        }
        WSDLReader wsdlReaderNoImport = wsdlFactory.newWSDLReader();
        wsdlReaderNoImport.setFeature("javax.wsdl.importDocuments", false);
        ExtensionRegistry extensionRegistry = new PopulatedExtensionRegistry();
        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
                extensionRegistry.getDefaultSerializer());

        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
                extensionRegistry.getDefaultSerializer());

        extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                UnknownExtensibilityElement.class);
        extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                extensionRegistry.getDefaultDeserializer());
        extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
                extensionRegistry.getDefaultSerializer());
        wsdlReaderNoImport.setExtensionRegistry(extensionRegistry);

        JarWSDLLocator wsdlLocator = new JarWSDLLocator(wsdlURI);
        WSDLReader wsdlReader = wsdlFactory.newWSDLReader();

        Thread thread = Thread.currentThread();
        ClassLoader oldCl = thread.getContextClassLoader();
        thread.setContextClassLoader(this.getClass().getClassLoader());
        try {
            try {
                definition = wsdlReader.readWSDL(wsdlLocator);
            } catch (WSDLException e) {
                throw new DeploymentException("Failed to read wsdl document", e);
            } catch (RuntimeException e) {
                throw new DeploymentException(e.getMessage(), e);
            }
        } finally {
            thread.setContextClassLoader(oldCl);
        }
View Full Code Here

            ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next();
            if (clazz.isAssignableFrom(extensibilityElement.getClass())) {
                return extensibilityElement;
            }
        }
        throw new DeploymentException("No element of class " + clazz.getName() + " found");
    }
View Full Code Here

                            }
                            portCursor.setAttributeText(LOCATION_QNAME, WebServiceContainer.LOCATION_REPLACEMENT_TOKEN + servletLocation);
                            return servletLocation;
                        }
                    } catch (URISyntaxException e) {
                        throw new DeploymentException("Could not construct URI for ejb location in wsdl", e);
                    } finally {
                        portCursor.dispose();
                    }
                }
            }
        }
        throw new DeploymentException("No port found with name " + portComponentName + " expected at " + servletLocation);
    }
View Full Code Here

    private static Configuration createTempConfiguration(Environment environment, ConfigurationModuleType moduleType, File baseDir, File inPlaceConfigurationDir, ConfigurationManager configurationManager, Naming naming) throws DeploymentException {
        try {
            configurationManager.loadConfiguration(new ConfigurationData(moduleType, null, null, null, environment, baseDir, inPlaceConfigurationDir, naming));
            return configurationManager.getConfiguration(environment.getConfigId());
        } catch (Exception e) {
            throw new DeploymentException("Unable to create configuration for deployment", e);
        }
    }
View Full Code Here

        getCompleteManifestClassPath(moduleFile, moduleBaseUri, resolutionUri, classpath, exclusions, new DefaultJarFileFactory(), problems);
        if (!problems.isEmpty()) {
            if (problems.size() == 1) {
                throw problems.get(0);
            }
            throw new DeploymentException("Determining complete manifest classpath unsuccessful:", problems);
        }
    }
View Full Code Here

    public void getCompleteManifestClassPath(JarFile moduleFile, URI moduleBaseUri, URI resolutionUri, ClassPathList classpath, ModuleList exclusions, JarFileFactory factory, List<DeploymentException> problems) throws DeploymentException {
        String manifestClassPath;
        try {
            manifestClassPath = factory.getManifestClassPath(moduleFile);
        } catch (IOException e) {
            problems.add(new DeploymentException(printInfo("Could not read manifest: " + moduleBaseUri, moduleBaseUri, classpath, exclusions), e));
            return;
        }

        if (manifestClassPath == null) {
            return;
        }

        for (StringTokenizer tokenizer = new StringTokenizer(manifestClassPath, " "); tokenizer.hasMoreTokens();) {
            String path = tokenizer.nextToken();

            URI pathUri;
            try {
                pathUri = new URI(path);
            } catch (URISyntaxException e) {
                problems.add(new DeploymentException(printInfo("Invalid manifest classpath entry, path=" + path, moduleBaseUri, classpath, exclusions)));
                return;
            }

            if (!pathUri.getPath().endsWith(".jar")) {
                problems.add(new DeploymentException(printInfo("Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): path=" + path, moduleBaseUri, classpath, exclusions)));
                return;
            }
            if (pathUri.isAbsolute()) {
                problems.add(new DeploymentException(printInfo("Manifest class path entries must be relative (J2EE 1.4 Section 8.2): path=" + path, moduleBaseUri, classpath, exclusions)));
                return;
            }

            URI targetUri = moduleBaseUri.resolve(pathUri);
            if (targetUri.getPath().endsWith("/")) {
                problems.add(new DeploymentException(printInfo("target path must not end with a '/' character: path=" + path + ", resolved to targetURI=" + targetUri, moduleBaseUri, classpath, exclusions)));
                return;
            }
            String targetEntry = targetUri.toString();
            if (exclusions.contains(targetEntry)) {
                continue;
            }
            URI resolvedUri = resolutionUri.resolve(targetUri);
            String classpathEntry = resolvedUri.toString();
            //don't get caught in circular references
            if (classpath.contains(classpathEntry)) {
                continue;
            }
            classpath.add(classpathEntry);

            JarFile classPathJarFile;
            try {
                classPathJarFile = factory.newJarFile(targetUri);
            } catch (IOException e) {
                problems.add(new DeploymentException(printInfo("Manifest class path entries must be a valid jar file (JAVAEE 5 Section 8.2): path=" + path + ", resolved to targetURI=" + targetUri, moduleBaseUri, classpath, exclusions), e));
                return;
            }

            getCompleteManifestClassPath(classPathJarFile, targetUri, resolutionUri, classpath, exclusions, factory, problems);
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.common.DeploymentException$CleanseException

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.