Package org.apache.geronimo.deployment

Examples of org.apache.geronimo.deployment.DeploymentException


            String type = resourceRef.getResType().getStringValue();
            Class iface = null;
            try {
                iface = cl.loadClass(type);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load class " + type, e);
            }
            RefAdapter refAdapter = (RefAdapter) refAdapterMap.get(name);
            try {
                builder.addResourceRef(name, iface, refAdapter);
            } catch (NamingException e) {
                throw new DeploymentException("Invalid env-entry definition for name: " + name, e);
            }
        }

    }
View Full Code Here


            String type = resourceEnvRef.getResourceEnvRefType().getStringValue();
            Class iface = null;
            try {
                iface = cl.loadClass(type);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load class " + type, e);
            }
            RefAdapter refAdapter = (RefAdapter) refAdapterMap.get(name);
            try {
                builder.addResourceRef(name, iface, refAdapter);
            } catch (NamingException e) {
                throw new DeploymentException("Invalid env-entry definition for name: " + name, e);
            }
        }
    }
View Full Code Here

        ConfigurationType configType = ((ConfigurationDocument) plan).getConfiguration();
        URI configID;
        try {
            configID = new URI(configType.getConfigId());
        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid configId " + configType.getConfigId(), e);
        }
        URI parentID;
        if (configType.isSetParentId()) {
            try {
                parentID = new URI(configType.getParentId());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Invalid parentId " + configType.getParentId(), e);
            }
        } else {
            parentID = null;
        }

        DeploymentContext context = null;
        try {
            context = new DeploymentContext(os, configID, parentID, kernel);
        } catch (MalformedObjectNameException e) {
            throw new DeploymentException(e);
        }
        addIncludes(context, configType);
        addDependencies(context, configType.getDependencyArray());
        ClassLoader cl = context.getClassLoader(repository);
        GbeanType[] gbeans = configType.getGbeanArray();
View Full Code Here

            }
            URI path;
            try {
                path = new URI(name);
            } catch (URISyntaxException e) {
                throw new DeploymentException("Unable to generate path for include: " + uri, e);
            }
            try {
                URL url = repository.getURL(uri);
                context.addInclude(path, url);
            } catch (IOException e) {
                throw new DeploymentException("Unable to add include: " + uri, e);
            }
        }
    }
View Full Code Here

            URL url;
            try {
                url = repository.getURL(dependencyURI);
            } catch (MalformedURLException e) {
                throw new DeploymentException("Unable to get URL for dependency " + dependencyURI, e);
            }
            ClassLoader depCL = new URLClassLoader(new URL[]{url}, ClassLoader.getSystemClassLoader());
            InputStream is = depCL.getResourceAsStream("META-INF/geronimo-service.xml");
            if (is != null) {
                // it has a geronimo-service.xml file
                ServiceDocument serviceDoc = null;
                try {
                    serviceDoc = ServiceDocument.Factory.parse(is);
                } catch (org.apache.xmlbeans.XmlException e) {
                    throw new DeploymentException("Invalid geronimo-service.xml file in " + url, e);
                } catch (IOException e) {
                    throw new DeploymentException("Unable to parse geronimo-service.xml file in " + url, e);
                }
                DependencyType[] dependencyDeps = serviceDoc.getService().getDependencyArray();
                if (dependencyDeps != null) {
                    addDependencies(context, dependencyDeps);
                }
View Full Code Here

        URI uri;
        if (dep.isSetUri()) {
            try {
                uri = new URI(dep.getUri());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Invalid dependency URI " + dep.getUri(), e);
            }
        } else {
            // @todo support more than just jars
            String id = dep.getGroupId() + "/jars/" + dep.getArtifactId() + '-' + dep.getVersion() + ".jar";
            try {
                uri = new URI(id);
            } catch (URISyntaxException e) {
                throw new DeploymentException("Unable to construct URI for groupId=" + dep.getGroupId() + ", artifactId=" + dep.getArtifactId() + ", version=" + dep.getVersion(), e);
            }
        }
        return uri;
    }
View Full Code Here

    public GBeanBuilder(String name, ClassLoader classLoader, String className) throws DeploymentException {
        try {
            this.name = new ObjectName(name);
        } catch (MalformedObjectNameException e) {
            throw new DeploymentException("Invalid ObjectName: " + name, e);
        }
        try {
            this.gbean = new GBeanMBean(className, classLoader);
        } catch (Exception e) {
            throw new DeploymentException("Unable to create GBean from class " + className, e);
        }
    }
View Full Code Here

    public void setAttribute(String name, String type, String text) throws DeploymentException {
        try {
            // @todo we should not need all of common just for this
            PropertyEditor editor = PropertyEditors.findEditor(type);
            if (editor == null) {
                throw new DeploymentException("Unable to find PropertyEditor for " + type);
            }
            editor.setAsText(text);
            Object value = editor.getValue();
            gbean.setAttribute(name, value);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Unable to find PropertyEditor for " + type, e);
        } catch (AttributeNotFoundException e) {
            throw new DeploymentException("Unknown attribute " + name);
        } catch (InvalidAttributeValueException e) {
            throw new DeploymentException("Invalid value for attribute " + name + ": " + text, e);
        } catch (Exception e) {
            throw new DeploymentException("Unable to set attribute " + name + " to " + text, e);
        }
    }
View Full Code Here

            JarOutputStream os = new JarOutputStream(new BufferedOutputStream(fos));
            DeploymentContext context = null;
            try {
                context = new DeploymentContext(os, configID, parentID, kernel);
            } catch (MalformedObjectNameException e) {
                throw new DeploymentException(e);
            }

            buildGBeanConfiguration(context, jettyWebApp, webApp, module.getAbsoluteFile().toURI());

            context.close();
View Full Code Here

    }

    private WebAppType getDD(File module) throws IOException, DeploymentException {
        File dd = new File(module, "WEB-INF/web.xml");
        if (!(dd.exists() && dd.canRead())) {
            throw new DeploymentException("Cannot read WEB-INF/web.xml from module directory");
        }
        FileInputStream is = new FileInputStream(dd);
        try {
            try {
                WebAppDocument doc = (WebAppDocument) XmlBeansUtil.parse(new BufferedInputStream(is), WebAppDocument.type);
                return doc.getWebApp();
            } catch (XmlException e) {
                throw new DeploymentException("Unable to parse web.xml", e);
            }
        } finally {
            try {
                is.close();
            } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.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.