Examples of MissingDependencyException


Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

     * @throws org.apache.geronimo.kernel.repository.MissingDependencyException
     *          if plugin requires a dependency that is not present
     */
    public void validatePlugin(PluginType plugin) throws MissingDependencyException {
        if (plugin.getPluginArtifact().size() != 1) {
            throw new MissingDependencyException("A plugin configuration must include one plugin artifact, not " + plugin.getPluginArtifact().size(), null, (Stack<Artifact>) null);
        }
        PluginArtifactType metadata = plugin.getPluginArtifact().get(0);
        // 1. Check that it's not already installed
        if (metadata.getModuleId() != null) { // that is, it's a real configuration not a plugin list
            Artifact artifact = toArtifact(metadata.getModuleId());
            if (configManager.isInstalled(artifact)) {
                boolean upgrade = false;
                for (ArtifactType obsolete : metadata.getObsoletes()) {
                    Artifact test = toArtifact(obsolete);
                    if (test.matches(artifact)) {
                        upgrade = true;
                        break;
                    }
                }
                if (!upgrade) {
                    log.info("Configuration " + artifact + " is already installed.");
                    throw new MissingDependencyException(
                            "Configuration " + artifact + " is already installed.", toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
                }
            }
        }

        // 2. Check that we meet the Geronimo, JVM versions
        if (metadata.getGeronimoVersion().size() > 0 && !checkGeronimoVersions(metadata.getGeronimoVersion())) {
            log.error("Cannot install plugin " + toArtifact(metadata.getModuleId()) + " on Geronimo " + serverInfo.getVersion());
            throw new MissingDependencyException(
                    "Cannot install plugin on Geronimo " + serverInfo.getVersion(), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
        if (metadata.getJvmVersion().size() > 0 && !checkJVMVersions(metadata.getJvmVersion())) {
            log.error("Cannot install plugin " + toArtifact(metadata.getModuleId()) + " on JVM " + System.getProperty(
                    "java.version"));
            throw new MissingDependencyException(
                    "Cannot install plugin on JVM " + System.getProperty("java.version"), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

                if (iter.hasNext()) {
                    buf.append(", ");
                }
            }
            buf.append(" to be installed");
            throw new MissingDependencyException(buf.toString(), null, (Artifact) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

     * @throws org.apache.geronimo.kernel.repository.MissingDependencyException
     *          if plugin requires a dependency that is not present
     */
    public void validatePlugin(PluginType plugin) throws MissingDependencyException {
        if (plugin.getPluginArtifact().size() != 1) {
            throw new MissingDependencyException("A plugin configuration must include one plugin artifact, not " + plugin.getPluginArtifact().size(), null, (Stack<Artifact>) null);
        }
        PluginArtifactType metadata = plugin.getPluginArtifact().get(0);
        // 1. Check that it's not already installed
        if (metadata.getModuleId() != null) { // that is, it's a real configuration not a plugin list
            Artifact artifact = toArtifact(metadata.getModuleId());
            if (configManager.isInstalled(artifact)) {
                boolean upgrade = false;
                for (ArtifactType obsolete : metadata.getObsoletes()) {
                    Artifact test = toArtifact(obsolete);
                    if (test.matches(artifact)) {
                        upgrade = true;
                        break;
                    }
                }
                if (!upgrade) {
                    log.debug("Configuration " + artifact + " is already installed.");
                    throw new MissingDependencyException(
                            "Configuration " + artifact + " is already installed.", toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
                }
            }
        }

        // 2. Check that we meet the Geronimo, JVM versions
        if (metadata.getGeronimoVersion().size() > 0 && !checkGeronimoVersions(metadata.getGeronimoVersion())) {
            log.debug("Plugin " + toArtifact(metadata.getModuleId()) + " is not installable on Geronimo " + serverInfo.getVersion());
            throw new MissingDependencyException(
                    "Plugin is not installable on Geronimo " + serverInfo.getVersion(), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
        if (metadata.getJvmVersion().size() > 0 && !checkJVMVersions(metadata.getJvmVersion())) {
            log.debug("Plugin " + toArtifact(metadata.getModuleId()) + " is not installable on JVM " + System.getProperty("java.version"));
            throw new MissingDependencyException(
                    "Plugin is not installable on JVM " + System.getProperty("java.version"), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

                if (iter.hasNext()) {
                    buf.append(", ");
                }
            }
            buf.append(" to be installed");
            throw new MissingDependencyException(buf.toString(), null, (Artifact) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

     * @throws org.apache.geronimo.kernel.repository.MissingDependencyException
     *          if plugin requires a dependency that is not present
     */
    public void validatePlugin(PluginType plugin) throws MissingDependencyException {
        if (plugin.getPluginArtifact().size() != 1) {
            throw new MissingDependencyException("A plugin configuration must include one plugin artifact, not " + plugin.getPluginArtifact().size(), null, (Stack<Artifact>) null);
        }
        PluginArtifactType metadata = plugin.getPluginArtifact().get(0);
        // 1. Check that it's not already installed
        if (metadata.getModuleId() != null) { // that is, it's a real configuration not a plugin list
            Artifact artifact = toArtifact(metadata.getModuleId());
            if (configManager.isInstalled(artifact)) {
                boolean upgrade = false;
                for (ArtifactType obsolete : metadata.getObsoletes()) {
                    Artifact test = toArtifact(obsolete);
                    if (test.matches(artifact)) {
                        upgrade = true;
                        break;
                    }
                }
                if (!upgrade) {
                    log.debug("Configuration " + artifact + " is already installed.");
                    throw new MissingDependencyException(
                            "Configuration " + artifact + " is already installed.", toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
                }
            }
        }

        // 2. Check that we meet the Geronimo, JVM versions
        if (metadata.getGeronimoVersion().size() > 0 && !checkGeronimoVersions(metadata.getGeronimoVersion())) {
            log.debug("Plugin " + toArtifact(metadata.getModuleId()) + " is not installable on Geronimo " + serverInfo.getVersion());
            throw new MissingDependencyException(
                    "Plugin is not installable on Geronimo " + serverInfo.getVersion(), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
        if (metadata.getJvmVersion().size() > 0 && !checkJVMVersions(metadata.getJvmVersion())) {
            log.debug("Plugin " + toArtifact(metadata.getModuleId()) + " is not installable on JVM " + System.getProperty("java.version"));
            throw new MissingDependencyException(
                    "Plugin is not installable on JVM " + System.getProperty("java.version"), toArtifact(metadata.getModuleId()), (Stack<Artifact>) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

                if (iter.hasNext()) {
                    buf.append(", ");
                }
            }
            buf.append(" to be installed");
            throw new MissingDependencyException(buf.toString(), null, (Artifact) null);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

            if (repository.contains(artifact)) {
                File file = repository.getLocation(artifact);
                return file;
            }
        }
        throw new MissingDependencyException("Unable to resolve dependency " + artifact);
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

            return dependency;
        }

        // we need an artifact resolver at this point
        if (artifactResolver == null) {
            throw new MissingDependencyException("Artifact is not resolved and there no artifact resolver available: " + artifact);
        }

        // resolve the artifact
        artifact = artifactResolver.resolveInClassLoader(artifact, parents);
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

        // 2. Check that we meet the prerequisites
        PluginMetadata.Prerequisite[] prereqs = metadata.getPrerequisites();
        for (int i = 0; i < prereqs.length; i++) {
            PluginMetadata.Prerequisite prereq = prereqs[i];
            if(resolver.queryArtifacts(prereq.getModuleId()).length == 0) {
                throw new MissingDependencyException("Required configuration '"+prereq.getModuleId()+"' is not installed.");
            }
        }
        // 3. Check that we meet the Geronimo, JVM versions
        if(metadata.getGeronimoVersions().length > 0 && !checkGeronimoVersions(metadata.getGeronimoVersions())) {
            throw new MissingDependencyException("Cannot install plugin "+metadata.getModuleId()+" on Geronimo "+serverInfo.getVersion());
        }
        if(metadata.getJvmVersions().length > 0 && !checkJVMVersions(metadata.getJvmVersions())) {
            throw new MissingDependencyException("Cannot install plugin "+metadata.getModuleId()+" on JVM "+System.getProperty("java.version"));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.MissingDependencyException

        InputStream in;
        LinkedList list = new LinkedList();
        list.addAll(Arrays.asList(repos));
        while (true) {
            if(list.isEmpty()) {
                throw new MissingDependencyException("Unable to download dependency "+artifact);
            }
            if(monitor != null) {
                monitor.setTotalBytes(-1); // Just to be sure
            }
            URL repository = (URL) list.removeFirst();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.