geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r767617 [1/2] - in /geronimo/sandbox/djencks/framework: buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/ configs/jee-specs/ m...
Date Wed, 22 Apr 2009 18:52:45 GMT
Author: djencks
Date: Wed Apr 22 18:52:43 2009
New Revision: 767617

URL: http://svn.apache.org/viewvc?rev=767617&view=rev
Log:
Better error reporting, lots of fixes.  One-classloader-per-jar works enough to start the server (with appropriate patches on non-framework)

Modified:
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
    geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/DependencyTest.java
    geronimo/sandbox/djencks/framework/configs/jee-specs/pom.xml
    geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/main/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilder.groovy
    geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/test/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilderTest.groovy
    geronimo/sandbox/djencks/framework/modules/geronimo-core/pom.xml
    geronimo/sandbox/djencks/framework/modules/geronimo-deploy-jsr88/pom.xml
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/GBeanAnnotationException.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ChildrenConfigurationClassLoader.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ClassLoaderHolder.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/JarFileClassLoaderFactory.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/BasicGlobalClassLoaderRegister.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/ConfigurationClassLoaderExtension.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/DependencySAXHandler.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/GlobalClassLoader.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/GlobalClassLoaderDependencyResolver.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/GlobalClassLoaderRegister.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/MavenDependencyResolver.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/MultiParentClassLoader2.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/OneClassLoaderPerJarClassLoaderBuilder.java
    geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/classloading/DependencyResolverTest.java
    geronimo/sandbox/djencks/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/sharedlib/SharedLib.java

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java Wed Apr 22 18:52:43 2009
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
@@ -90,7 +89,7 @@
      * @readonly
      */
     protected MavenProjectHelper projectHelper;
-    
+
     /**
      * The basedir of the project.
      *
@@ -100,7 +99,7 @@
      */
     protected File basedir;
 
-    protected Set<Artifact> dependencies;
+    protected Set<Artifact> dependencyArtifacts;
     protected Map<Artifact, Set<Artifact>> localDependencies;
 
 
@@ -316,7 +315,7 @@
                     project.getRemoteArtifactRepositories(), artifactMetadataSource, null,
                     Collections.singletonList(listener));
 
-            dependencies = result.getArtifacts();
+            this.dependencyArtifacts = result.getArtifacts();
             rootNode = listener.getRootNode();
         }
         catch (ArtifactResolutionException exception) {
@@ -358,9 +357,9 @@
         return new org.apache.geronimo.kernel.repository.Artifact(groupId, artifactId, version, type);
     }
 
-    protected LinkedHashSet<DependencyType> toDependencies(Collection<Dependency> listedDependencies, UseMavenDependencies useMavenDependencies, boolean includeImport) throws InvalidDependencyVersionException, ArtifactResolutionException, ProjectBuildingException, MojoExecutionException {
+    protected LinkedHashSet<DependencyType> toDependencies(List<Dependency> explicitDependencies, UseMavenDependencies useMavenDependencies, boolean includeImport) throws InvalidDependencyVersionException, ArtifactResolutionException, ProjectBuildingException, MojoExecutionException {
         List<DependencyType> dependencyTypes = new ArrayList<DependencyType>();
-        for (Dependency dependency: listedDependencies) {
+        for (Dependency dependency : explicitDependencies) {
             dependencyTypes.add(dependency.toDependencyType());
         }
         LinkedHashSet<DependencyType> dependencies = new LinkedHashSet<DependencyType>();
@@ -378,9 +377,9 @@
             for (Map.Entry<Artifact, Set<Artifact>> entry : localDependencies.entrySet()) {
                 Artifact artifact = entry.getKey();
                 DependencyType explicitDependency = explicitDependencyMap.get(getKey(artifact));
-                DependencyType dependency = toDependency(artifact, useMavenDependencies.isIncludeVersion(), explicitDependency, includeImport);
-                for (Artifact parent: entry.getValue()) {
-                    dependency.getDependency().add(toDependency(parent, true, null, false));
+                DependencyType dependency = toDependencyType(artifact, useMavenDependencies.isIncludeVersion(), explicitDependency, includeImport);
+                for (Artifact parent : entry.getValue()) {
+                    dependency.getDependency().add(toDependencyType(parent, true, null, false));
                 }
                 dependencies.add(dependency);
             }
@@ -389,7 +388,7 @@
         return dependencies;
     }
 
-    private DependencyType toDependency(Artifact artifact, boolean includeVersion, DependencyType explicitDependency, boolean includeImport) {
+    DependencyType toDependencyType(Artifact artifact, boolean includeVersion, DependencyType explicitDependency, boolean includeImport) {
         DependencyType dependency = new DependencyType();
         dependency.setGroupId(artifact.getGroupId());
         dependency.setArtifactId(artifact.getArtifactId());
@@ -404,15 +403,16 @@
         }
         if (explicitDependency != null) {
             dependency.setStart(explicitDependency.isStart());
+            dependency.getDependency().addAll(explicitDependency.getDependency());
         }
         return dependency;
     }
 
-    private String getKey(DependencyType dependency) {
+    private static String getKey(DependencyType dependency) {
         return dependency.getGroupId() + "/" + dependency.getArtifactId() + "/" + dependency.getType();
     }
 
-    private String getKey(Artifact dependency) {
+    private static String getKey(Artifact dependency) {
         return dependency.getGroupId() + "/" + dependency.getArtifactId() + "/" + dependency.getType();
     }
 
@@ -571,7 +571,7 @@
     }
 
     protected Artifact resolveArtifact(String groupId, String artifactId, String type) {
-        for (Artifact artifact : dependencies) {
+        for (Artifact artifact : dependencyArtifacts) {
             if (matches(groupId, artifactId, type, artifact)) {
                 return artifact;
             }

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java Wed Apr 22 18:52:43 2009
@@ -20,17 +20,12 @@
 package org.apache.geronimo.mavenplugins.car;
 
 import java.io.File;
-import java.util.LinkedHashSet;
-import java.util.List;
 
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
-import org.apache.maven.project.ProjectBuildingException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
 
 /**

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java Wed Apr 22 18:52:43 2009
@@ -20,8 +20,12 @@
 
 package org.apache.geronimo.mavenplugins.car;
 
+import java.util.List;
+import java.util.ArrayList;
+
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.system.plugin.model.DependencyType;
+import org.apache.geronimo.system.plugin.model.ArtifactType;
 
 /**
  * @version $Rev$ $Date$
@@ -33,6 +37,10 @@
      */
     private Boolean start;
 
+    /**
+     * @parameter
+     */
+    private List<Dependency> dependencies = new ArrayList<Dependency>();
 
     public Boolean isStart() {
         if (start == null) {
@@ -45,6 +53,14 @@
         this.start = start;
     }
 
+    public List<Dependency> getDependencies() {
+        return dependencies;
+    }
+
+    public void setDependencies(List<Dependency> dependencies) {
+        this.dependencies = dependencies;
+    }
+
     public DependencyType toDependencyType() {
         DependencyType dependency = new DependencyType();
         dependency.setGroupId(groupId);
@@ -54,9 +70,22 @@
         dependency.setStart(start);
         dependency.setImport(getImport() == null? org.apache.geronimo.system.plugin.model.ImportType.ALL:
                 org.apache.geronimo.system.plugin.model.ImportType.fromValue(getImport()));
+
+        for (Dependency artifact: this.dependencies) {
+            dependency.getDependency().add(artifact.toArtifact());
+        }
         return dependency;
     }
 
+    private ArtifactType toArtifact() {
+        ArtifactType artifactType = new ArtifactType();
+        artifactType.setGroupId(groupId);
+        artifactType.setArtifactId(artifactId);
+        artifactType.setVersion(version);
+        artifactType.setType(type);
+        return artifactType;
+    }
+
     public org.apache.geronimo.kernel.repository.Dependency toKernelDependency() {
         org.apache.geronimo.kernel.repository.Artifact artifact = new org.apache.geronimo.kernel.repository.Artifact(groupId, artifactId, version, type);
         ImportType importType = getImport() == null? ImportType.ALL: ImportType.getByName(getImport());
@@ -82,18 +111,9 @@
 
         Dependency that = (Dependency) o;
         if (!super.equals(that)) return false;
-        return isStart().equals(that.isStart());
+        if (!isStart().equals(that.isStart())) return false;
+        return getDependencies().equals(that.getDependencies());
     }
     //rely on super.hashcode();
 
-    public static Dependency newDependency(DependencyType dependencyType) {
-        Dependency dependency = new Dependency();
-        dependency.setGroupId(dependencyType.getGroupId());
-        dependency.setArtifactId(dependencyType.getArtifactId());
-        dependency.setVersion(dependencyType.getVersion());
-        dependency.setType(dependencyType.getType());
-        dependency.setStart(dependencyType.isStart());
-        dependency.setImport(ImportType.ALL.toString());
-        return dependency;
-    }
 }

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java Wed Apr 22 18:52:43 2009
@@ -32,7 +32,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import java.util.ArrayList;
 import java.util.LinkedHashSet;
 
 import javax.xml.bind.JAXBException;

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java Wed Apr 22 18:52:43 2009
@@ -24,8 +24,6 @@
 import java.util.List;
 import java.util.Set;
 import java.util.Collections;
-import java.net.URL;
-import java.net.URI;
 
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.basic.BasicKernel;
@@ -148,7 +146,7 @@
     public void execute() throws MojoExecutionException, MojoFailureException {
         getDependencies(project, false);
         Maven2RepositoryAdapter.ArtifactLookup lookup = new ArtifactLookupImpl();
-        SourceRepository sourceRepo = new Maven2RepositoryAdapter(dependencies, lookup);
+        SourceRepository sourceRepo = new Maven2RepositoryAdapter(dependencyArtifacts, lookup);
         PluginListType pluginList = new PluginListType();
         String localRepo = sourceRepository.getUrl();
         if ("file".equals(sourceRepository.getProtocol())) {

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java Wed Apr 22 18:52:43 2009
@@ -214,7 +214,7 @@
             }
 
 
-            generateExplicitVersionProperties(explicitResolutionProperties, dependencies);
+            generateExplicitVersionProperties(explicitResolutionProperties, dependencyArtifacts);
 
             //
             // NOTE: Install a local lookup, so that the cached kernel can resolve based on the current project
@@ -260,7 +260,7 @@
 
         File targetFile = new File(targetDir.toURI().resolve(pluginMetadataFileName));
         URL artifactURL = targetFile.toURL();
-        new MavenDependencyResolver().resolve(artifactURL, OneClassLoaderPerJarClassLoaderBuilder.GLOBAL_CL_REGISTER);
+        new MavenDependencyResolver().resolve(artifactURL, OneClassLoaderPerJarClassLoaderBuilder.GLOBAL_CL_REGISTER, mavenToGeronimoArtifact(getProject().getArtifact()));
         boot.bootstrap();
     }
 
@@ -342,7 +342,7 @@
         if (kernel != null) {
             return kernel;
         }
-
+        OneClassLoaderPerJarClassLoaderBuilder.GLOBAL_CL_REGISTER.cleanClassLoaderRegistry();
         getLog().debug("Creating kernel...");
 
         // check the registry in case someone else created one
@@ -397,7 +397,7 @@
             }
         };
         repoGBean.setAttribute("lookup", lookup);
-        repoGBean.setAttribute("dependencies", dependencies);
+        repoGBean.setAttribute("dependencies", dependencyArtifacts);
         repoNames.add(repoGBean.getAbstractName());
 
         // Target repo
@@ -447,7 +447,7 @@
 
         File targetFile = new File(targetDir.toURI().resolve(pluginMetadataFileName));
         URL artifactURL = targetFile.toURL();
-        new MavenDependencyResolver().resolve(artifactURL, OneClassLoaderPerJarClassLoaderBuilder.GLOBAL_CL_REGISTER);
+        new MavenDependencyResolver().resolve(artifactURL, OneClassLoaderPerJarClassLoaderBuilder.GLOBAL_CL_REGISTER, mavenToGeronimoArtifact(getProject().getArtifact()));
 
     }
 

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java Wed Apr 22 18:52:43 2009
@@ -116,7 +116,7 @@
 
             XmlObject doc = XmlObject.Factory.parse(filteredPlanFile);
             XmlCursor xmlCursor = doc.newCursor();
-            LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> dependencies = toKernelDependencies(this.dependencies, useMavenDependencies);
+            LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> dependencies = toKernelDependencies(useMavenDependencies);
             Artifact configId = new Artifact(project.getGroupId(), project.getArtifactId(), project.getVersion(), "car");
 
             try {
@@ -223,9 +223,9 @@
         }
     }
 
-    protected LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> toKernelDependencies(List<Dependency> listedDependencies, UseMavenDependencies useMavenDependencies) throws InvalidDependencyVersionException, ArtifactResolutionException, ProjectBuildingException, MojoExecutionException {
+    protected LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> toKernelDependencies(UseMavenDependencies useMavenDependencies) throws InvalidDependencyVersionException, ArtifactResolutionException, ProjectBuildingException, MojoExecutionException {
         LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> kernelDependencies = new LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency>();
-        LinkedHashSet<DependencyType> dependencies = toDependencies(listedDependencies, useMavenDependencies, true);
+        LinkedHashSet<DependencyType> dependencies = toDependencies(this.dependencies, useMavenDependencies, true);
         for (DependencyType dependency: dependencies) {
             kernelDependencies.add(Dependency.toKernelDependency(dependency));
         }

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java Wed Apr 22 18:52:43 2009
@@ -27,11 +27,9 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.LinkedHashSet;
-import java.util.ArrayList;
 
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.repository.Maven2Repository;
 import org.apache.geronimo.system.plugin.PluginXmlUtil;
 import org.apache.geronimo.system.plugin.model.ArtifactType;
 import org.apache.geronimo.system.plugin.model.LicenseType;

Modified: geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/DependencyTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/DependencyTest.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/DependencyTest.java (original)
+++ geronimo/sandbox/djencks/framework/buildsupport/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/DependencyTest.java Wed Apr 22 18:52:43 2009
@@ -24,6 +24,7 @@
 
 import junit.framework.TestCase;
 import org.apache.geronimo.system.plugin.model.DependencyType;
+import org.apache.geronimo.kernel.repository.ImportType;
 
 /**
  * @version $Rev$ $Date$
@@ -77,7 +78,7 @@
     public void testDependencyTypeConversion() throws Exception {
         Dependency d1 = newDependency(null);
         DependencyType td = d1.toDependencyType();
-        Dependency d2 = Dependency.newDependency(td);
+        Dependency d2 = newDependencyFromType(td);
         assertTrue(d1.equals(d2));
     }
 
@@ -94,4 +95,16 @@
         d.setImport("all");
         return d;
     }
+
+    public static Dependency newDependencyFromType(DependencyType dependencyType) {
+        Dependency dependency = new Dependency();
+        dependency.setGroupId(dependencyType.getGroupId());
+        dependency.setArtifactId(dependencyType.getArtifactId());
+        dependency.setVersion(dependencyType.getVersion());
+        dependency.setType(dependencyType.getType());
+        dependency.setStart(dependencyType.isStart());
+        dependency.setImport(ImportType.ALL.toString());
+        return dependency;
+    }
+
 }

Modified: geronimo/sandbox/djencks/framework/configs/jee-specs/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/configs/jee-specs/pom.xml?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/configs/jee-specs/pom.xml (original)
+++ geronimo/sandbox/djencks/framework/configs/jee-specs/pom.xml Wed Apr 22 18:52:43 2009
@@ -40,8 +40,8 @@
 
         <!-- activation is needed in root cl to run jaxb -->
         <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.specs</groupId>-->
-            <!--<artifactId>geronimo-activation_1.1_spec</artifactId>-->
+        <!--<groupId>org.apache.geronimo.specs</groupId>-->
+        <!--<artifactId>geronimo-activation_1.1_spec</artifactId>-->
         <!--</dependency>-->
 
         <dependency>
@@ -53,10 +53,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ejb_3.0_spec</artifactId>
         </dependency>
-        
-         <dependency>
-           <groupId>org.apache.openejb</groupId>
-           <artifactId>ejb31-api-experimental</artifactId>
+
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>ejb31-api-experimental</artifactId>
         </dependency>
 
         <dependency>
@@ -84,7 +84,7 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jacc_1.1_spec</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaspi_1.0_spec</artifactId>
@@ -197,7 +197,7 @@
             <version>${version}</version>
             <type>car</type>
         </dependency>
-        
+
         <!-- build order hint -->
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
@@ -227,6 +227,100 @@
                             <type>car</type>
                             <import>classes</import>
                         </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.geronimo.specs</groupId>
+                            <artifactId>geronimo-jacc_1.1_spec</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>${servletSpec}</artifactId>
+                                    <version>1.2</version>
+                                    <type>jar</type>
+                                </dependency>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>geronimo-ejb_3.0_spec</artifactId>
+                                    <version>1.0.1</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.specs</groupId>
+                            <artifactId>geronimo-jsp_2.1_spec</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>${servletSpec}</artifactId>
+                                    <version>1.2</version>
+                                    <type>jar</type>
+                                </dependency>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>geronimo-el_1.0_spec</artifactId>
+                                    <version>1.0.1</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>jstl</groupId>
+                            <artifactId>jstl</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>geronimo-jsp_2.1_spec</artifactId>
+                                    <version>1.0.1</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.specs</groupId>
+                            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>geronimo-ejb_3.0_spec</artifactId>
+                                    <version>1.0.1</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.openejb</groupId>
+                            <artifactId>ejb31-api-experimental</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>geronimo-ejb_3.0_spec</artifactId>
+                                    <version>1.0.1</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+
+                        <dependency>
+                            <groupId>org.apache.myfaces.core</groupId>
+                            <artifactId>myfaces-api</artifactId>
+                            <type>jar</type>
+                            <dependencies>
+                                <dependency>
+                                    <groupId>org.apache.geronimo.specs</groupId>
+                                    <artifactId>${servletSpec}</artifactId>
+                                    <version>1.2</version>
+                                    <type>jar</type>
+                                </dependency>
+                            </dependencies>
+                        </dependency>
+
                     </dependencies>
 
                 </configuration>

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/main/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilder.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/main/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilder.groovy?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/main/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilder.groovy (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/main/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilder.groovy Wed Apr 22 18:52:43 2009
@@ -1,13 +1,99 @@
-/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.geronimo.kernel.config.transformer
 
import org.apache.geronimo.kernel.Jsr77Naming
import org.apache.geronimo.gbean.GBeanInfo
import org.apache.geronimo.gbean.GBe
 anData
import org.apache.geronimo.gbean.GBeanData
import org.apache.geronimo.kernel.repository.Version
import org.apache.geronimo.kernel.config.ConfigurationData
import org.apache.geronimo.kernel.repository.ImportType
import org.apache.geronimo.kernel.repository.Artifact
import org.apache.geronimo.kernel.repository.Dependency
-
/**
 *
 * @version $Rev:$ $Date:$
 */
class ConfigurationDataBuilder {
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.kernel.config.transformer
+ 
+import org.apache.geronimo.kernel.Jsr77Naming
+import org.apache.geronimo.gbean.GBeanInfo
+import org.apache.geronimo.gbean.GBeanData
+import org.apache.geronimo.gbean.GBeanData
+import org.apache.geronimo.kernel.repository.Version
+import org.apache.geronimo.kernel.config.ConfigurationData
+import org.apache.geronimo.kernel.repository.ImportType
+import org.apache.geronimo.kernel.repository.Artifact
+import org.apache.geronimo.kernel.repository.Dependency
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+class ConfigurationDataBuilder {
     private final ConfigurationData configurationData
     
     ConfigurationDataBuilder(ConfigurationData configurationData) {
         assert null != configurationData : 'configurationData is required'
         this.configurationData = configurationData
-    }
    
    def configure (Closure closure) {
        closure.delegate = this
        closure()
    }
+    }
+    
+    def configure (Closure closure) {
+        closure.delegate = this
+        closure()
+    }
+
+    def addDependency(Map dependencyDeclaration) throws GroovyScriptException {
+        def throwUsage = {
+            throw new GroovyScriptException('addDependency usage: addDependency(groupId: group, artifactId: artifact, version: X, type: type, importType: ImportType.X)')
+        }
 
-    def addDependency(Map dependencyDeclaration) throws GroovyScriptException {
        def throwUsage = {
            throw new GroovyScriptException('addDependency usage: addDependency(groupId: group, artifactId: artifact, version: X, type: type, importType: ImportType.X)')
        }

        ensureNotNull(dependencyDeclaration.groupId, throwUsage)
        ensureNotNull(dependencyDeclaration.artifactId, throwUsage)

        if (!dependencyDeclaration.type) {
            dependencyDeclaration.type = 'jar'
        }

        def artifact = buildArtifact(dependencyDeclaration)
        
        def importType = dependencyDeclaration.importType
        if (!importType) {
            importType = ImportType.ALL
        }
        
        configurationData.environment.addDependency(artifact, importType)
    }
-    
    def removeDependency(Map dependencyFilter) throws GroovyScriptException {
        def throwUsage = {
            throw new GroovyScriptException('removeDependency usage: removeDependency(groupId: group, artifactId: artifact, version: X, type: type)')
        }

        def filteredArtifact = buildArtifact(dependencyFilter)
        def filteredDependencies = configurationData.environment.dependencies.findAll { dependency ->
            !filteredArtifact.matches(dependency.artifact)
        }

        configurationData.environment.dependencies = filteredDependencies
    }
-
    protected def buildArtifact(dependencyDeclaration) throws GroovyScriptException {
        def groupId = dependencyDeclaration.groupId
        def artifactId = dependencyDeclaration.artifactId
        def version = dependencyDeclaration.version
        def type = dependencyDeclaration.type

        new Artifact(groupId, artifactId, (String) version, type)
    }
    
    protected def ensureNotNull(value, throwUsage) throws GroovyScriptException {
        if (!value) {
            throwUsage()
        }
    }
    
+        ensureNotNull(dependencyDeclaration.groupId, throwUsage)
+        ensureNotNull(dependencyDeclaration.artifactId, throwUsage)
+
+        if (!dependencyDeclaration.type) {
+            dependencyDeclaration.type = 'jar'
+        }
+
+        def artifact = buildArtifact(dependencyDeclaration)
+        
+        def importType = dependencyDeclaration.importType
+        if (!importType) {
+            importType = ImportType.ALL
+        }
+        
+        configurationData.environment.addDependency(artifact, importType)
+    }
+    
+    def removeDependency(Map dependencyFilter) throws GroovyScriptException {
+        def throwUsage = {
+            throw new GroovyScriptException('removeDependency usage: removeDependency(groupId: group, artifactId: artifact, version: X, type: type)')
+        }
+
+        def filteredArtifact = buildArtifact(dependencyFilter)
+        def filteredDependencies = configurationData.environment.dependencies.findAll { dependency ->
+            !filteredArtifact.matches(dependency.artifact)
+        }
+
+        configurationData.environment.dependencies = filteredDependencies
+    }
+
+    protected def buildArtifact(dependencyDeclaration) throws GroovyScriptException {
+        def groupId = dependencyDeclaration.groupId
+        def artifactId = dependencyDeclaration.artifactId
+        def version = dependencyDeclaration.version
+        def type = dependencyDeclaration.type
+
+        new Artifact(groupId, artifactId, (String) version, type)
+    }
+    
+    protected def ensureNotNull(value, throwUsage) throws GroovyScriptException {
+        if (!value) {
+            throwUsage()
+        }
+    }
+    
 }
\ No newline at end of file

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/test/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilderTest.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/test/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilderTest.groovy?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/test/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilderTest.groovy (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-config-groovy-transformer/src/test/groovy/org/apache/geronimo/kernel/config/transformer/ConfigurationDataBuilderTest.groovy Wed Apr 22 18:52:43 2009
@@ -19,8 +19,14 @@
 
 package org.apache.geronimo.kernel.config.transformer
 
-import org.apache.geronimo.kernel.config.transformer.ConfigurationDataBuilder
import org.apache.geronimo.kernel.repository.ImportType
-import org.apache.geronimo.kernel.config.ConfigurationData
import org.apache.geronimo.kernel.Jsr77Naming
import org.apache.geronimo.kernel.repository.Artifact
import org.apache.geronimo.kernel.config.transformer.GroovyScriptException

/**
+import org.apache.geronimo.kernel.config.transformer.ConfigurationDataBuilder
+import org.apache.geronimo.kernel.repository.ImportType
+import org.apache.geronimo.kernel.config.ConfigurationData
+import org.apache.geronimo.kernel.Jsr77Naming
+import org.apache.geronimo.kernel.repository.Artifact
+import org.apache.geronimo.kernel.config.transformer.GroovyScriptException
+
+/**
  *
  * @version $Rev:$ $Date:$
  */

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-core/pom.xml?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-core/pom.xml (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-core/pom.xml Wed Apr 22 18:52:43 2009
@@ -53,6 +53,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
     </dependencies>
     
 </project>

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-deploy-jsr88/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-deploy-jsr88/pom.xml?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-deploy-jsr88/pom.xml (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-deploy-jsr88/pom.xml Wed Apr 22 18:52:43 2009
@@ -30,20 +30,20 @@
 
     <artifactId>geronimo-deploy-jsr88</artifactId>
     <name>Geronimo Framework, Modules :: Deploy JSR-88</name>
-    
+
     <dependencies>
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-system</artifactId>
             <version>${version}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-common</artifactId>
             <version>${version}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-plugin</artifactId>
@@ -55,6 +55,24 @@
             <artifactId>geronimo-deploy-config</artifactId>
             <version>${version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-archiver</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-javaee-deployment_1.1MR3_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-crypto</artifactId>
+            <version>${version}</version>
+        </dependency>
     </dependencies>
 
 </project>

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java Wed Apr 22 18:52:43 2009
@@ -296,7 +296,7 @@
         try {
             methods = intf.getMethods();
         } catch (NoClassDefFoundError e) {
-            throw (NoClassDefFoundError)new NoClassDefFoundError("could not get methods from interface: " + intf.getName() + " loaded in classLoader: " + intf.getClassLoader()).initCause(e);
+            throw (NoClassDefFoundError)new NoClassDefFoundError("could not get methods from interface: " + intf.getName() + " due to: " + e.getMessage() + " loaded in classLoader: " + intf.getClassLoader()).initCause(e);
         }
         for (int i = 0; i < methods.length; i++) {
             Method method = methods[i];

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java Wed Apr 22 18:52:43 2009
@@ -20,6 +20,8 @@
 package org.apache.geronimo.gbean;
 
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.geronimo.gbean.annotation.AnnotationGBeanInfoFactory;
 
@@ -45,23 +47,27 @@
     }
     
     public GBeanInfo getGBeanInfo(Class clazz) throws GBeanInfoFactoryException {
+        List<GBeanInfoFactoryException> errors = new ArrayList<GBeanInfoFactoryException>(2);
         for (GBeanInfoFactory factory : FACTORIES) {
             try {
                 return factory.getGBeanInfo(clazz);
             } catch (GBeanInfoFactoryException e) {
+                errors.add(e);
             }
         }
-        throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + clazz + "]");
+        throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + clazz + "], errors: " + errors);
     }
 
     public GBeanInfo getGBeanInfo(String className, ClassLoader classLoader) throws GBeanInfoFactoryException {
+        List<GBeanInfoFactoryException> errors = new ArrayList<GBeanInfoFactoryException>(2);
         for (GBeanInfoFactory factory : FACTORIES) {
             try {
                 return factory.getGBeanInfo(className, classLoader);
             } catch (GBeanInfoFactoryException e) {
+                errors.add(e);
             }
         }
-        throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + className + "]");
+        throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + className + "], errors: " + errors);
     }
     
 }
\ No newline at end of file

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java Wed Apr 22 18:52:43 2009
@@ -53,16 +53,20 @@
     }
 
     public GBeanInfo buildGBeanInfo() throws GBeanAnnotationException {
-        String name = getName();
-        String j2eeType = getJ2eeyType();
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(name, gbeanClass, j2eeType);
-        
-        setPriority(infoBuilder);
-        setConstructor(infoBuilder);
-        markPersistent(infoBuilder);
-        addReferences(infoBuilder);
-        
-        return infoBuilder.getBeanInfo();
+        try {
+            String name = getName();
+            String j2eeType = getJ2eeyType();
+            GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(name, gbeanClass, j2eeType);
+
+            setPriority(infoBuilder);
+            setConstructor(infoBuilder);
+            markPersistent(infoBuilder);
+            addReferences(infoBuilder);
+
+            return infoBuilder.getBeanInfo();
+        } catch (NoClassDefFoundError e) {
+            throw new GBeanAnnotationException("Could not fully load class: " + gbeanClass.getName() + "\n due to: " + e.getMessage() +  "\n in classloader \n" + gbeanClass.getClassLoader(), e);
+        }
     }
     
     protected void setPriority(GBeanInfoBuilder infoBuilder) {

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/GBeanAnnotationException.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/GBeanAnnotationException.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/GBeanAnnotationException.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/GBeanAnnotationException.java Wed Apr 22 18:52:43 2009
@@ -33,4 +33,7 @@
         super(message);
     }
 
+    public GBeanAnnotationException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
 }

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ChildrenConfigurationClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ChildrenConfigurationClassLoader.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ChildrenConfigurationClassLoader.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ChildrenConfigurationClassLoader.java Wed Apr 22 18:52:43 2009
@@ -30,6 +30,7 @@
 import org.apache.geronimo.kernel.config.classloading.ConfigurationClassLoaderExtension;
 import org.apache.geronimo.kernel.repository.ClassLoadingRule;
 import org.apache.geronimo.kernel.repository.ClassLoadingRules;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 import sun.misc.CompoundEnumeration;
 
@@ -37,7 +38,7 @@
  *
  * @version $Rev:$ $Date:$
  */
-public class ChildrenConfigurationClassLoader extends SecureClassLoader {
+public class ChildrenConfigurationClassLoader extends SecureClassLoader implements ConfigurationClassLoaderExtension{
 
     private final ClassLoadingRules rules;
 
@@ -49,15 +50,20 @@
         this.rules = rules;
     }
 
-    public Class<?> loadClass(String name, List<ClassLoader> visitedClassLoaders) throws ClassNotFoundException {
-        return loadClass(name, false, visitedClassLoaders);
+    public Class<?> loadClass(String name, List<ConfigurationClassLoaderExtension> visitedClassLoaders) throws ClassNotFoundException {
+        return loadClassInternal(name, false, visitedClassLoaders);
     }
     
     protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-        return loadClass(name, resolve, Collections.EMPTY_LIST);
+        return loadClassInternal(name, resolve, Collections.EMPTY_LIST);
     }
 
-    protected synchronized Class<?> loadClass(String name, boolean resolve, List<ClassLoader> visitedClassLoaders)
+    public void addURL(URL url) {
+        throw new RuntimeException("Don't call this");
+    }
+
+    //TODO use inheritance to make protected??
+    public synchronized Class<?> loadClassInternal(String name, boolean resolve, List<ConfigurationClassLoaderExtension> visitedClassLoaders)
             throws ClassNotFoundException {
         ClassLoadingRule privateRule = rules.getPrivateRule();
         ClassLoader parent = getParent();
@@ -73,7 +79,24 @@
         }
         return super.loadClass(name, resolve);
     }
-    
+
+    public void destroy() {
+    }
+
+    //TODO????
+    public URL findResource(String name) {
+        return super.findResource(name);
+    }
+
+    //TODO????
+    public Enumeration<URL> findResources(String name) throws IOException {
+        return super.findResources(name);
+    }
+
+    public Artifact getId() {
+        return ((ConfigurationClassLoaderExtension)getParent()).getId();
+    }
+
     public URL getResource(String name) {
         ClassLoadingRule privateRule = rules.getPrivateRule();
         if (privateRule.isFilteredResource(name)) {
@@ -90,4 +113,8 @@
         return super.getResources(name);
     }
 
+    @Override
+    public String toString() {
+        return "ChildrenConfigurationClassLoader: " + getId();
+    }
 }

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ClassLoaderHolder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ClassLoaderHolder.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ClassLoaderHolder.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ClassLoaderHolder.java Wed Apr 22 18:52:43 2009
@@ -21,6 +21,7 @@
 package org.apache.geronimo.kernel.config;
 
 import org.apache.geronimo.kernel.config.classloading.ConfigurationClassLoaderExtension;
+import org.apache.geronimo.kernel.config.classloading.OneClassLoaderPerJarClassLoaderBuilder;
 
 /**
  * @version $Rev$ $Date$
@@ -45,6 +46,8 @@
 
     public void destroy() {
         if (internalClassLoader instanceof ConfigurationClassLoaderExtension) {
+            //TODO this sucks
+            OneClassLoaderPerJarClassLoaderBuilder.unregister((ConfigurationClassLoaderExtension) externalClassLoader);
             ((ConfigurationClassLoaderExtension)internalClassLoader).destroy();
         }
     }

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/JarFileClassLoaderFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/JarFileClassLoaderFactory.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/JarFileClassLoaderFactory.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/JarFileClassLoaderFactory.java Wed Apr 22 18:52:43 2009
@@ -72,7 +72,7 @@
             Artifact id = configuration.getId();
             parentsById.put(id, configuration);
         }
-        //TODO why the complexigy? why not just use parents passed in?
+        //TODO why the complexigt? why not just use parents passed in?
         for (Dependency dependency : transitiveDependencies) {
             Artifact artifact = dependency.getArtifact();
             if (parentsById.containsKey(artifact)) {
@@ -87,21 +87,13 @@
             }
         }
 
-            //
-            // Build the configuration class loader
-            //
-            ClassLoader configurationClassLoader = createConfigurationClasssLoader(parents, environment, classPath, classParents, dependencies, configurationResolver);
-
-            ClassLoadingRules rules = environment.getClassLoadingRules();
-            ClassLoader childrenConfigurationClassLoader = new ChildrenConfigurationClassLoader(configurationClassLoader, rules);
-
-        return new ClassLoaderHolder(configurationClassLoader, childrenConfigurationClassLoader);
+        //
+        // Build the configuration class loader
+        //
+        return createConfigurationClasssLoader(parents, environment, classPath, classParents, dependencies, configurationResolver);
     }
 
-    private ClassLoader createConfigurationClasssLoader(Collection<Configuration> parents, Environment environment, LinkedHashSet<String> classPath, Collection<Configuration> classParents, LinkedHashSet<Artifact> dependencies, ConfigurationResolver configurationResolver) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
-        // create the URL list
-        LinkedHashMap<Artifact, URL[]> artifactToURL = buildClassPath(dependencies, classPath, configurationResolver, environment);
-
+    private ClassLoaderHolder createConfigurationClasssLoader(Collection<Configuration> parents, Environment environment, LinkedHashSet<String> classPath, Collection<Configuration> classParents, LinkedHashSet<Artifact> dependencies, ConfigurationResolver configurationResolver) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
         // parents
         List<ClassLoader> parentClassLoaders;
         if (parents.size() == 0 && classParents.size() == 0) {
@@ -126,87 +118,85 @@
             nonOverrideableRule.merge(parentNonOverrideableRule);
         }
 
+        // create the URL list
+        LinkedHashMap<Artifact, URL[]> dependencyUrls = buildDependenciesClassPath(dependencies, configurationResolver);
+        URL[] resolvedClassPath = buildClassPath(classPath, configurationResolver);
+
         if (log.isDebugEnabled()) {
             StringBuffer buf = new StringBuffer("ClassLoader structure for configuration ").append(environment.getConfigId()).append("\n");
             buf.append("Parent configurations:\n");
             for (Configuration configuration : classParents) {
                 buf.append("     ").append(configuration.getId()).append("\n");
             }
-            buf.append("ClassPath:\n");
-            for (URL[] urls : artifactToURL.values()) {
-                for (URL url : urls) {
+            buf.append("dependencies:\n");
+            for (Map.Entry<Artifact, URL[]> dep : dependencyUrls.entrySet()) {
+                buf.append("     ").append(dep.getKey()).append("\n");
+                for (URL url : dep.getValue()) {
                     buf.append("     ").append(url).append("\n");
                 }
             }
             log.debug(buf.toString());
         }
 
-        if (true || Boolean.getBoolean("Xorg.apache.geronimo.OneClassLoaderPerJar")) {
-            OneClassLoaderPerJarClassLoaderBuilder classLoaderBuilder = new OneClassLoaderPerJarClassLoaderBuilder();
-            return classLoaderBuilder.build(environment, parentClassLoaders, classLoadingRules, artifactToURL, configurationResolver);
-        }
+        OneClassLoaderPerJarClassLoaderBuilder classLoaderBuilder = new OneClassLoaderPerJarClassLoaderBuilder();
+        return classLoaderBuilder.build(environment, parentClassLoaders, classLoadingRules, dependencyUrls, resolvedClassPath, configurationResolver);
 
-        URL[] urls = flattenedURLs(artifactToURL);
-
-        // The JarFileClassLoader was created to address a locking problem seen only on Windows platforms.
-        // It carries with it a slight performance penalty that needs to be addressed.  Rather than make
-        // *nix OSes carry this burden we'll engage the JarFileClassLoader for Windows or if the user
-        // specifically requests it.  We'll look more at this issue in the future.
-        boolean useJarFileClassLoader;
-        if (System.getProperty("Xorg.apache.geronimo.JarFileClassLoader") == null) {
-            useJarFileClassLoader = System.getProperty("os.name").startsWith("Windows");
-        } else {
-            useJarFileClassLoader = Boolean.getBoolean("Xorg.apache.geronimo.JarFileClassLoader");
-        }
-        if (useJarFileClassLoader) {
-            return new JarFileClassLoader(environment.getConfigId(),
-                    urls,
-                    parentClassLoaders,
-                    classLoadingRules);
-        } else {
-            return new MultiParentClassLoader(environment.getConfigId(),
-                    urls,
-                    parentClassLoaders,
-                    classLoadingRules);
-        }
+//        URL[] urls = flattenedURLs(artifactToURL);
+//
+//        // The JarFileClassLoader was created to address a locking problem seen only on Windows platforms.
+//        // It carries with it a slight performance penalty that needs to be addressed.  Rather than make
+//        // *nix OSes carry this burden we'll engage the JarFileClassLoader for Windows or if the user
+//        // specifically requests it.  We'll look more at this issue in the future.
+//        boolean useJarFileClassLoader;
+//        if (System.getProperty("Xorg.apache.geronimo.JarFileClassLoader") == null) {
+//            useJarFileClassLoader = System.getProperty("os.name").startsWith("Windows");
+//        } else {
+//            useJarFileClassLoader = Boolean.getBoolean("Xorg.apache.geronimo.JarFileClassLoader");
+//        }
+//        if (useJarFileClassLoader) {
+//            return new JarFileClassLoader(environment.getConfigId(),
+//                    urls,
+//                    parentClassLoaders,
+//                    classLoadingRules);
+//        } else {
+//            return new MultiParentClassLoader(environment.getConfigId(),
+//                    urls,
+//                    parentClassLoaders,
+//                    classLoadingRules);
+//        }
     }
 
-    protected URL[] flattenedURLs(LinkedHashMap<Artifact, URL[]> artifactToURL) {
-        Collection<URL[]> urlsCollection = artifactToURL.values();
-        Set<URL> flattenedURLs = new HashSet<URL>();
-        for (URL[] urls : urlsCollection) {
-            for (URL url : urls) {
-                flattenedURLs.add(url);
-            }
-        }
-        return flattenedURLs.toArray(new URL[flattenedURLs.size()]);
-    }
-    
-    private LinkedHashMap<Artifact, URL[]> buildClassPath(LinkedHashSet<Artifact> dependencies, 
-            LinkedHashSet<String> classPath, 
-            ConfigurationResolver configurationResolver, 
-            Environment environment) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
+//    protected URL[] flattenedURLs(LinkedHashMap<Artifact, URL[]> artifactToURL) {
+//        Collection<URL[]> urlsCollection = artifactToURL.values();
+//        Set<URL> flattenedURLs = new HashSet<URL>();
+//        for (URL[] urls : urlsCollection) {
+//            for (URL url : urls) {
+//                flattenedURLs.add(url);
+//            }
+//        }
+//        return flattenedURLs.toArray(new URL[flattenedURLs.size()]);
+//    }
+
+    private LinkedHashMap<Artifact, URL[]> buildDependenciesClassPath(LinkedHashSet<Artifact> dependencies,
+                                                                      ConfigurationResolver configurationResolver) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
         LinkedHashMap<Artifact, URL[]> artifactToURL = new LinkedHashMap<Artifact, URL[]>();
         for (Artifact artifact : dependencies) {
             File file = configurationResolver.resolve(artifact);
-            artifactToURL.put(artifact, new URL[] {file.toURL()});
+            artifactToURL.put(artifact, new URL[]{file.toURL()});
         }
+        return artifactToURL;
+    }
+
+    private URL[] buildClassPath(LinkedHashSet<String> classPath,
+                                 ConfigurationResolver configurationResolver) throws MalformedURLException, MissingDependencyException, NoSuchConfigException {
+        Set<URL> allMatches = new HashSet<URL>();
         if (classPath != null) {
-            Set<URL> allMatches = new HashSet<URL>();
             for (String pattern : classPath) {
                 Set<URL> matches = configurationResolver.resolve(pattern);
                 allMatches.addAll(matches);
             }
-            if (!allMatches.isEmpty()) {
-                Artifact configId = environment.getConfigId();
-                Artifact artifact = new Artifact(configId.getGroupId(),
-                    configId.getArtifactId()  + "-classPath",
-                    configId.getVersion(),
-                    configId.getType());
-                artifactToURL.put(artifact, allMatches.toArray(new URL[allMatches.size()]));
-            }            
         }
-        return artifactToURL;
+        return allMatches.toArray(new URL[allMatches.size()]);
     }
 
 }

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java Wed Apr 22 18:52:43 2009
@@ -53,8 +53,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class MultiParentClassLoader extends URLClassLoader implements ConfigurationClassLoaderExtension
-{
+public class MultiParentClassLoader extends URLClassLoader implements ConfigurationClassLoaderExtension {
     private static final Logger log = LoggerFactory.getLogger(MultiParentClassLoader.class);
 
     private final Artifact id;
@@ -70,26 +69,26 @@
     private final static int OPTIMIZED_SEARCH = 2;
 
     private final static boolean LONG_CLASSLOADER_TO_STRING = false;
-     
+
     static {
-    	// Extract the classLoaderSearchMode if specified.  If not, default to "safe".
-    	String mode = System.getProperty("Xorg.apache.geronimo.kernel.config.MPCLSearchOption");
-    	int runtimeMode = OPTIMIZED_SEARCH;  // Default to optimized
-    	String runtimeModeMessage = "Original Classloading";
-    	if (mode != null) { 
-    		if (mode.equals("safe")) {
+        // Extract the classLoaderSearchMode if specified.  If not, default to "safe".
+        String mode = System.getProperty("Xorg.apache.geronimo.kernel.config.MPCLSearchOption");
+        int runtimeMode = OPTIMIZED_SEARCH;  // Default to optimized
+        String runtimeModeMessage = "Original Classloading";
+        if (mode != null) {
+            if (mode.equals("safe")) {
                 runtimeMode = ORIGINAL_SEARCH;
                 runtimeModeMessage = "Safe ClassLoading";
-    		} else if (mode.equals("optimized"))
-    			runtimeMode = OPTIMIZED_SEARCH;
-    	}
-    	
-		classLoaderSearchMode = runtimeMode;
-		LoggerFactory.getLogger(MultiParentClassLoader.class).info(
-                 "ClassLoading behaviour has changed.  The "+runtimeModeMessage+" mode is in effect.  If you are experiencing a problem\n"+
-				 "you can change the behaviour by specifying -DXorg.apache.geronimo.kernel.config.MPCLSearchOption= property.  Specify \n"+
-				 "=\"safe\" to revert to the original behaviour.  This is a temporary change until we decide whether or not to make it\n"+
-				 "permanent for the 2.0 release");
+            } else if (mode.equals("optimized"))
+                runtimeMode = OPTIMIZED_SEARCH;
+        }
+
+        classLoaderSearchMode = runtimeMode;
+        LoggerFactory.getLogger(MultiParentClassLoader.class).info(
+                "ClassLoading behaviour has changed.  The " + runtimeModeMessage + " mode is in effect.  If you are experiencing a problem\n" +
+                        "you can change the behaviour by specifying -DXorg.apache.geronimo.kernel.config.MPCLSearchOption= property.  Specify \n" +
+                        "=\"safe\" to revert to the original behaviour.  This is a temporary change until we decide whether or not to make it\n" +
+                        "permanent for the 2.0 release");
     }
 
     /**
@@ -101,7 +100,7 @@
     public MultiParentClassLoader(Artifact id, URL[] urls) {
         super(urls);
         this.id = id;
-        
+
         parents = new ArrayList<ClassLoader>(Collections.singleton(ClassLoader.getSystemClassLoader()));
         classLoadingRules = new ClassLoadingRules();
         ClassLoaderRegistry.add(this);
@@ -191,7 +190,7 @@
         super(urls, null, factory);
         this.id = id;
         this.parents = new ArrayList<ClassLoader>(parents);
-        
+
         classLoadingRules = new ClassLoadingRules();
         ClassLoaderRegistry.add(this);
     }
@@ -234,19 +233,19 @@
     }
 
     /**
-     * TODO This method should be removed and replaced with the best classLoading option.  Its intent is to 
+     * TODO This method should be removed and replaced with the best classLoading option.  Its intent is to
      * provide a way for folks to switch back to the old classLoader if this fix breaks something.
      */
     protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-    	if (classLoaderSearchMode == ORIGINAL_SEARCH) 
-    		return loadSafeClass(name, resolve);
-    	else
-    		return loadOptimizedClass(name, resolve);
+        if (classLoaderSearchMode == ORIGINAL_SEARCH)
+            return loadSafeClass(name, resolve);
+        else
+            return loadOptimizedClass(name, resolve);
     }
-    
+
     /**
      * This method executes the old class loading behaviour before optimization.
-     * 
+     *
      * @param name
      * @param resolve
      * @return
@@ -317,22 +316,20 @@
         }
 
         throw new ClassNotFoundException(name + " in classloader " + id);
-    }    
-    
+    }
+
     /**
-     * 
      * Optimized classloading.
-     * 
-     * This method is the normal way to resolve class loads.  This method recursively calls its parents to resolve 
+     * <p/>
+     * This method is the normal way to resolve class loads.  This method recursively calls its parents to resolve
      * classloading requests.  Here is the sequence of operations:
-     * 
-     *   1. Call findLoadedClass to see if we already have this class loaded.
-     *   2. If this class is a java.* or data primitive class, call the SystemClassLoader.
-     *   3. If inverse loading and class is not in the non-overridable list, check the local ClassLoader.
-     *   4. If the class is not a hidden class, search our parents, recursively.  Keeping track of which parents have already been called.
-     *      Since MultiParentClassLoaders can appear more than once we do not search an already searched ClassLoader.
-     *   5. Finally, search this ClassLoader.  
-     * 
+     * <p/>
+     * 1. Call findLoadedClass to see if we already have this class loaded.
+     * 2. If this class is a java.* or data primitive class, call the SystemClassLoader.
+     * 3. If inverse loading and class is not in the non-overridable list, check the local ClassLoader.
+     * 4. If the class is not a hidden class, search our parents, recursively.  Keeping track of which parents have already been called.
+     * Since MultiParentClassLoaders can appear more than once we do not search an already searched ClassLoader.
+     * 5. Finally, search this ClassLoader.
      */
     protected synchronized Class<?> loadOptimizedClass(String name, boolean resolve) throws ClassNotFoundException {
 
@@ -355,7 +352,7 @@
                 name.equals("double") ||
                 name.equals("long")) {
             try {
-        	    return resolveClass(findSystemClass(name), resolve);
+                return resolveClass(findSystemClass(name), resolve);
             } catch (ClassNotFoundException cnfe) {
                 // ignore...just being a good citizen.
             }
@@ -371,18 +368,18 @@
             } catch (ClassNotFoundException ignored) {
             }
         }
-        
+
         //
         // Check parent class loaders
         //
         if (!isHiddenClass(name)) {
-       		try {
-       			LinkedList<ClassLoader> visitedClassLoaders = new LinkedList<ClassLoader>();
+            try {
+                LinkedList<ConfigurationClassLoaderExtension> visitedClassLoaders = new LinkedList<ConfigurationClassLoaderExtension>();
                 Class clazz = checkParents(name, resolve, visitedClassLoaders);
                 if (clazz != null) return resolveClass(clazz, resolve);
-      		} catch (ClassNotFoundException cnfe) {
-        			// ignore
-       		}
+            } catch (ClassNotFoundException cnfe) {
+                // ignore
+            }
         }
 
         //
@@ -401,19 +398,19 @@
 
         throw new ClassNotFoundException(name + " in classloader " + id);
     }
-    
+
     /**
      * This method is an internal hook that allows us to be performant on Class lookups when multiparent
      * classloaders are involved.  We can bypass certain lookups that have already occurred in the initiating
      * classloader.  Also, we track the classLoaders that are visited by adding them to an already vistied list.
      * In this way, we can bypass redundant checks for the same class.
-     * 
+     *
      * @param name
      * @param visitedClassLoaders
      * @return
      * @throws ClassNotFoundException
      */
-    public synchronized Class<?> loadClassInternal(String name, boolean resolve, List<ClassLoader> visitedClassLoaders) throws ClassNotFoundException, MalformedURLException {
+    public synchronized Class<?> loadClassInternal(String name, boolean resolve, List<ConfigurationClassLoaderExtension> visitedClassLoaders) throws ClassNotFoundException, MalformedURLException {
         //
         // Check if class is in the loaded classes cache
         //
@@ -427,13 +424,13 @@
         //
         if (!isHiddenClass(name)) {
             try {
-        	    Class clazz = checkParents(name, resolve, visitedClassLoaders);
-        	    if (clazz != null) return resolveClass(clazz,resolve);
+                Class clazz = checkParents(name, resolve, visitedClassLoaders);
+                if (clazz != null) return resolveClass(clazz, resolve);
             } catch (ClassNotFoundException cnfe) {
-        	    // ignore
+                // ignore
             }
         }
-        
+
         //
         // if we are not using inverse class loading, check local urls now
         //
@@ -441,7 +438,7 @@
         // have alredy checked he parent and the parent didn't have the
         // class, so we can override now
         if (!isDestroyed()) {
-        	Class clazz = findClass(name);
+            Class clazz = findClass(name);
             return resolveClass(clazz, resolve);
         }
 
@@ -449,40 +446,43 @@
     }
 
     /**
-     * In order to optimize the classLoading process and visit a directed set of 
-     * classloaders this internal method for Geronimo MultiParentClassLoaders 
+     * In order to optimize the classLoading process and visit a directed set of
+     * classloaders this internal method for Geronimo MultiParentClassLoaders
      * is used.  Effectively, as each classloader is visited it is passed a linked
      * list of classloaders that have already been visited and can safely be skipped.
      * This method assumes the context of an MPCL and is not for use external to this class.
-     * 
+     *
      * @param name
      * @param visitedClassLoaders
      * @return
      * @throws ClassNotFoundException
      */
-    private synchronized Class<?> checkParents(String name, boolean resolve, List<ClassLoader> visitedClassLoaders) throws ClassNotFoundException {
+    private synchronized Class<?> checkParents(String name, boolean resolve, List<ConfigurationClassLoaderExtension> visitedClassLoaders) throws ClassNotFoundException {
         for (ClassLoader parent : parents) {
             if (!visitedClassLoaders.contains(parent)) {
-                visitedClassLoaders.add(parent);  // Track that we've been here before
+                //TODO inefficient
+                if (parent instanceof ConfigurationClassLoaderExtension) {
+                    visitedClassLoaders.add((ConfigurationClassLoaderExtension) parent);  // Track that we've been here before
+                }
                 try {
-        	        if (parent instanceof MultiParentClassLoader) {
-        	        	Class clazz = ((MultiParentClassLoader) parent).loadClassInternal(name, resolve, visitedClassLoaders);
-        	        	if (clazz != null) return resolveClass(clazz, resolve);
-        	        } else if (parent instanceof ChildrenConfigurationClassLoader) {
+                    if (parent instanceof MultiParentClassLoader) {
+                        Class clazz = ((MultiParentClassLoader) parent).loadClassInternal(name, resolve, visitedClassLoaders);
+                        if (clazz != null) return resolveClass(clazz, resolve);
+                    } else if (parent instanceof ChildrenConfigurationClassLoader) {
                         Class clazz = ((ChildrenConfigurationClassLoader) parent).loadClass(name, visitedClassLoaders);
                         if (clazz != null) return resolveClass(clazz, resolve);
-        	        } else {
-        	        	return parent.loadClass(name);
-        	        }
-    	    	} catch (ClassNotFoundException cnfe) {
+                    } else {
+                        return parent.loadClass(name);
+                    }
+                } catch (ClassNotFoundException cnfe) {
                     // ignore
                 } catch (MalformedURLException me) {
                     log.debug("Failed findClass for {}", name, me);
                 }
             }
-    	} 
-     	// To avoid yet another CNFE we'll simply return null and let the caller handle appropriately.
-    	return null;
+        }
+        // To avoid yet another CNFE we'll simply return null and let the caller handle appropriately.
+        return null;
     }
 
     private boolean isNonOverridableClass(String name) {
@@ -619,7 +619,7 @@
             return;
         }
         if (childClassLoader instanceof MultiParentClassLoader) {
-            for (ClassLoader cl: ((MultiParentClassLoader)childClassLoader).parents) {
+            for (ClassLoader cl : ((MultiParentClassLoader) childClassLoader).parents) {
                 ancestors.add(cl);
                 getAncestorsInternal(ancestors, cl);
             }
@@ -629,7 +629,7 @@
             getAncestorsInternal(ancestors, cl);
         }
     }
-    
+
     public String toString() {
         StringBuilder b = new StringBuilder();
         if (LONG_CLASSLOADER_TO_STRING) {
@@ -644,14 +644,14 @@
         b.append(indent).append("[").append(getClass().getName()).append(" id=").append(id).append("]\n");
         b.append(indent).append("urls:\n");
         String newIndent = indent + "  ";
-        for (URL url: getURLs()) {
+        for (URL url : getURLs()) {
             b.append(newIndent).append(url).append("\n");
         }
         b.append(indent).append("parents:\n");
 
-        for (ClassLoader cl: parents) {
+        for (ClassLoader cl : parents) {
             if (cl instanceof MultiParentClassLoader) {
-                ((MultiParentClassLoader)cl).toBuilder(b, newIndent);
+                ((MultiParentClassLoader) cl).toBuilder(b, newIndent);
             } else {
                 b.append(newIndent).append(cl.toString()).append("\n");
             }
@@ -710,5 +710,5 @@
         ClassLoaderRegistry.remove(this);
         super.finalize();
     }
-    
+
 }

Modified: geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/BasicGlobalClassLoaderRegister.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/BasicGlobalClassLoaderRegister.java?rev=767617&r1=767616&r2=767617&view=diff
==============================================================================
--- geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/BasicGlobalClassLoaderRegister.java (original)
+++ geronimo/sandbox/djencks/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/classloading/BasicGlobalClassLoaderRegister.java Wed Apr 22 18:52:43 2009
@@ -32,29 +32,39 @@
 public class BasicGlobalClassLoaderRegister implements GlobalClassLoaderRegister {
 
     final Map<Artifact, Set<Artifact>> graph = new HashMap<Artifact, Set<Artifact>>();
-    final Map<Artifact, GlobalClassLoader> register;
-    final Map<Artifact, GlobalClassLoader> noVersionRegister;
+    final Map<Artifact, ConfigurationClassLoaderExtension> register;
+    final Map<Artifact, ConfigurationClassLoaderExtension> noVersionRegister;
+    private final Map<Artifact, Set<Artifact>> artifactToSourceDoc = new HashMap<Artifact, Set<Artifact>>();
 
     public BasicGlobalClassLoaderRegister() {
-        register = new HashMap<Artifact, GlobalClassLoader>();
-        noVersionRegister = new HashMap<Artifact, GlobalClassLoader>();
+        register = new HashMap<Artifact, ConfigurationClassLoaderExtension>();
+        noVersionRegister = new HashMap<Artifact, ConfigurationClassLoaderExtension>();
     }
 
-    public void register(Artifact child, Set<Artifact> parents) {
+    public void register(Artifact child, Set<Artifact> parents, Artifact docSourceArtifact) {
         if (child == null) throw new NullPointerException("child required");
         if (parents == null) throw new NullPointerException("parents required");
+        Set<Artifact> oldSource = artifactToSourceDoc.get(child);
+        if (oldSource == null) {
+            oldSource = new HashSet<Artifact>();
+            artifactToSourceDoc.put(child, oldSource);
+        }
+        if (oldSource.contains(docSourceArtifact)) return; //hack to help with deployment by car-maven-plugin
         Set<Artifact> old = graph.put(child, parents);
         if (old != null && !old.equals(parents)) {
             HashSet<Artifact> removed = new HashSet<Artifact>(old);
             removed.removeAll(parents);
             HashSet<Artifact> added = new HashSet<Artifact>(parents);
-            added.removeAll(parents);
+            added.removeAll(old);
             throw new IllegalArgumentException("parents of artifact: " + child +
-                    " changed:\nold: " + old +
-                    "\nnew: " + parents +
-                    "\nremoved: " + removed +
-                    "\n added: " + added);
+                    " changed:\n old: " + old +
+                    "\n new: " + parents +
+                    "\n removed: " + removed +
+                    "\n added: " + added +
+                    "\n previously from sources: " + oldSource +
+                    "\n now: " + docSourceArtifact);
         }
+        oldSource.add(docSourceArtifact);
     }
 
     public void unregister(Artifact artifact) {
@@ -67,23 +77,28 @@
         return parents;
     }
 
-    public void register(GlobalClassLoader classLoader) {
+    public void cleanClassLoaderRegistry() {
+        register.clear();
+        noVersionRegister.clear();
+    }
+
+    public void register(ConfigurationClassLoaderExtension classLoader) {
         synchronized (register) {
-            register.put(classLoader.getArtifact(), classLoader);
-            noVersionRegister.put(strip(classLoader.getArtifact()), classLoader);
+            register.put(classLoader.getId(), classLoader);
+            noVersionRegister.put(strip(classLoader.getId()), classLoader);
         }
     }
 
-    public void unregister(GlobalClassLoader classLoader) {
+    public void unregister(ConfigurationClassLoaderExtension classLoader) {
         synchronized (register) {
-            register.remove(classLoader.getArtifact());
-            register.remove(strip(classLoader.getArtifact()));
+            register.remove(classLoader.getId());
+            register.remove(strip(classLoader.getId()));
         }
     }
 
-    public GlobalClassLoader retrieve(Artifact artifact) {
+    public ConfigurationClassLoaderExtension retrieve(Artifact artifact) {
         synchronized (register) {
-            GlobalClassLoader cl = register.get(artifact);
+            ConfigurationClassLoaderExtension cl = register.get(artifact);
             if (cl == null) {
                 cl = noVersionRegister.get(strip(artifact));
             }



Mime
View raw message