Index: core/src/java/com/sun/enterprise/module/common_impl/AbstractModulesRegistryImpl.java =================================================================== --- core/src/java/com/sun/enterprise/module/common_impl/AbstractModulesRegistryImpl.java (revision 3606) +++ core/src/java/com/sun/enterprise/module/common_impl/AbstractModulesRegistryImpl.java (working copy) @@ -106,7 +106,7 @@ * any modules to see these classes. */ protected final Map providers = new HashMap(); - private Map habitats = new Hashtable(); + private Map habitats = new Hashtable(); protected AbstractModulesRegistryImpl(AbstractModulesRegistryImpl parent) { this.parent = parent; @@ -171,7 +171,7 @@ // default modules registry is the one that created the habitat habitat.addIndex(new ExistingSingletonInhabitant(this), ModulesRegistry.class.getName(), null); - habitats.put(name, habitat); + habitats.put(habitat, name); habitat.initialized(); @@ -385,9 +385,9 @@ for( String name : spi.providerNames ) providers.put(name,newModule); } - for (Map.Entry entry : habitats.entrySet()) { - String name = entry.getKey(); - Habitat h = entry.getValue(); + for (Map.Entry entry : habitats.entrySet()) { + String name = entry.getValue(); + Habitat h = entry.getKey(); try { // TODO: should get the inhabitantsParser out of Main instead since