plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21ServerInfo.java [275:326]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void updateCommonLibs() {
        List<Object> artifacts = null;
        commonLibs = new ArrayList<Dependency>();
        Map map = Collections.singletonMap("j2eeType", "Repository");
        AbstractNameQuery query = new AbstractNameQuery(null, map,
                Collections.EMPTY_SET);
        for (int i = 0; i < kernels.size(); i++) {
            Set beans = kernels.get(i).listGBeans(query);
            try {
                for (Iterator it = beans.iterator(); it.hasNext();) {
                    AbstractName abstractName = (AbstractName) it.next();
                    try {
                        GBeanInfo info = kernels.get(i).getGBeanInfo(abstractName);
                        Object value = kernels.get(i).invoke(abstractName, "list");
                        if (value instanceof TreeSet) {
                            artifacts = Arrays.asList(((TreeSet) value).toArray());
                        }
                    } catch (GBeanNotFoundException e) {
                        Trace.trace(Trace.WARNING, "GBean Not Found. "
                                + e.getMessage(), Activator.logCore);
                    } catch (NoSuchOperationException e) {
                        Trace.trace(Trace.WARNING, "The operation cant invoked. "
                                + e.getMessage(), Activator.logCore);
                    } catch (InternalKernelException e) {
                        throw e;
                    } catch (Exception e) {
                        Trace.trace(Trace.WARNING, "Kernel connection failed.  "
                                + e.getMessage(), Activator.logCore);
                    }
                    
                }
            }  catch(ClassCastException e) {
                // Just ignore as could be 2.1's AbstractName even in 2.2
                Trace.trace(Trace.INFO, "The class is not match: "  + e.getMessage(), Activator.logCore);
            }
        }
        if (artifacts != null) {
            for (int i = 0; i < artifacts.size(); i++) {
                Dependency dependency = new Dependency();
                dependency.setArtifactId(((Artifact) artifacts.get(i))
                        .getArtifactId());
                dependency.setGroupId(((Artifact) artifacts.get(i))
                        .getGroupId());
                dependency.setVersion(((Artifact) artifacts.get(i))
                        .getVersion().toString());
                dependency.setType(((Artifact) artifacts.get(i)).getType());
                if (!commonLibs.contains(dependency)) {
                    commonLibs.add(dependency);
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoV22ServerInfo.java [280:331]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void updateCommonLibs() {
        List<Object> artifacts = null;
        commonLibs = new ArrayList<Dependency>();
        Map map = Collections.singletonMap("j2eeType", "Repository");
        AbstractNameQuery query = new AbstractNameQuery(null, map,
                Collections.EMPTY_SET);
        for (int i = 0; i < kernels.size(); i++) {
            Set beans = kernels.get(i).listGBeans(query);
            try {
                for (Iterator it = beans.iterator(); it.hasNext();) {
                    AbstractName abstractName = (AbstractName) it.next();
                    try {
                        GBeanInfo info = kernels.get(i).getGBeanInfo(abstractName);
                        Object value = kernels.get(i).invoke(abstractName, "list");
                        if (value instanceof TreeSet) {
                            artifacts = Arrays.asList(((TreeSet) value).toArray());
                        }
                    } catch (GBeanNotFoundException e) {
                        Trace.trace(Trace.WARNING, "GBean Not Found. "
                                + e.getMessage(), Activator.logCore);
                    } catch (NoSuchOperationException e) {
                        Trace.trace(Trace.WARNING, "The operation cant invoked. "
                                + e.getMessage(), Activator.logCore);
                    } catch (InternalKernelException e) {
                        throw e;
                    } catch (Exception e) {
                        Trace.trace(Trace.WARNING, "Kernel connection failed.  "
                                + e.getMessage(), Activator.logCore);
                    }
                    
                }
            }  catch(ClassCastException e) {
                // Just ignore as could be 2.1's AbstractName even in 2.2
                Trace.trace(Trace.INFO, "The class is not match: "  + e.getMessage(), Activator.logCore);
            }
        }
        if (artifacts != null) {
            for (int i = 0; i < artifacts.size(); i++) {
                Dependency dependency = new Dependency();
                dependency.setArtifactId(((Artifact) artifacts.get(i))
                        .getArtifactId());
                dependency.setGroupId(((Artifact) artifacts.get(i))
                        .getGroupId());
                dependency.setVersion(((Artifact) artifacts.get(i))
                        .getVersion().toString());
                dependency.setType(((Artifact) artifacts.get(i)).getType());
                if (!commonLibs.contains(dependency)) {
                    commonLibs.add(dependency);
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



