geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r982493 [1/2] - in /geronimo/server/trunk/plugins: axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/ client/client/src/main/history/ clie...
Date Thu, 05 Aug 2010 07:54:33 GMT
Author: djencks
Date: Thu Aug  5 07:54:32 2010
New Revision: 982493

URL: http://svn.apache.org/viewvc?rev=982493&view=rev
Log:
GERONIMO-5066 Fix a lot of problems with jndi including wrong finders and inconsistent adding of injections

Modified:
    geronimo/server/trunk/plugins/axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
    geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
    geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
    geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/ejb-expected.xml
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java
    geronimo/server/trunk/plugins/openejb/openejb-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceRefBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/plugins/tomcat/pom.xml

Modified: geronimo/server/trunk/plugins/axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/axis/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -31,6 +31,7 @@ import javax.xml.namespace.QName;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.HandlerInfoInfo;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -45,6 +46,8 @@ import org.apache.geronimo.xbeans.javaee
 import org.apache.geronimo.xbeans.javaee6.PortComponentRefType;
 import org.apache.geronimo.xbeans.javaee6.ServiceRefType;
 import org.apache.geronimo.xbeans.javaee6.XsdQNameType;
+import org.apache.openejb.jee.JndiConsumer;
+import org.apache.openejb.jee.ServiceRef;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
@@ -72,32 +75,38 @@ public class AxisServiceRefBuilder exten
         return specDD.selectChildren(serviceRefQNameSet).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
-        List<ServiceRefType> serviceRefsUntyped = convert(specDD.selectChildren(serviceRefQNameSet), JEE_CONVERTER, ServiceRefType.class, ServiceRefType.type);
-        XmlObject[] gerServiceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_SERVICE_REF_QNAME_SET);
-        Map serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);
-
-        for (ServiceRefType serviceRef : serviceRefsUntyped) {
-            String name = getStringValue(serviceRef.getServiceRefName());
-            addInjections(name, serviceRef.getInjectionTargetArray(), componentContext);
-            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
-            serviceRefMap.remove(name);
-            buildNaming(serviceRef, serviceRefType, module, componentContext);
-        }
-
-        if (serviceRefMap.size() > 0) {
-            log.warn("Failed to build reference to service reference "+serviceRefMap.keySet()+" defined in plan file, reason - corresponding entry in deployment descriptor missing.");
-        }
-    }
-
-    public void buildNaming(XmlObject serviceRef, GerServiceRefType gerServiceRefType, Module module, Map componentContext) throws DeploymentException {
-        ServiceRefType serviceRefType =
-                (ServiceRefType) convert(serviceRef, JEE_CONVERTER, ServiceRefType.type);
-        buildNaming(serviceRefType, gerServiceRefType, module, componentContext);
-    }
-
-    private void buildNaming(ServiceRefType serviceRef, GerServiceRefType serviceRefType, Module module, Map componentContext) throws DeploymentException {
-        String name = getStringValue(serviceRef.getServiceRefName());
+//    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+//        List<ServiceRefType> serviceRefsUntyped = convert(specDD.selectChildren(serviceRefQNameSet), JEE_CONVERTER, ServiceRefType.class, ServiceRefType.type);
+//        XmlObject[] gerServiceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_SERVICE_REF_QNAME_SET);
+//        Map serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);
+//
+//        for (ServiceRefType serviceRef : serviceRefsUntyped) {
+//            String name = getStringValue(serviceRef.getServiceRefName());
+//            addInjections(name, serviceRef.getInjectionTargetArray(), componentContext);
+//            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
+//            serviceRefMap.remove(name);
+//            buildNaming(serviceRef, serviceRefType, module, componentContext);
+//        }
+//
+//        if (serviceRefMap.size() > 0) {
+//            log.warn("Failed to build reference to service reference "+serviceRefMap.keySet()+" defined in plan file, reason - corresponding entry in deployment descriptor missing.");
+//        }
+//    }
+
+//    public void buildNaming(XmlObject serviceRef, GerServiceRefType gerServiceRefType, Module module, Map componentContext) throws DeploymentException {
+//        ServiceRefType serviceRefType =
+//                (ServiceRefType) convert(serviceRef, JEE_CONVERTER, ServiceRefType.type);
+//        buildNaming(serviceRefType, gerServiceRefType, module, componentContext);
+//    }
+
+    @Override
+    public void buildNaming(JndiConsumer jndiConsumer, XmlObject xmlObject, Module module, Map<EARContext.Key, Object> keyObjectMap) throws DeploymentException {
+    }
+
+    @Override
+    public void buildNaming(ServiceRef serviceRef, GerServiceRefType gerServiceRefType, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
+        //TODO name needs to be normalized or get normalized name from jee's map.
+        String name = normalize(getStringValue(serviceRef.getServiceRefName()));
         Bundle bundle = module.getEarContext().getDeploymentBundle();
 
 //            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
@@ -151,7 +160,7 @@ public class AxisServiceRefBuilder exten
 
 //we could get a Reference or the actual serializable Service back.
         Object ref = axisBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, module, bundle);
-        put(name, ref, getJndiContextMap(componentContext));
+        put(name, ref, module.getJndiContext(), serviceRef.getInjectionTarget(), sharedContext);
         //getJndiContextMap(componentContext).put(ENV + name, ref);
     }
 
@@ -245,4 +254,5 @@ public class AxisServiceRefBuilder exten
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
 }

Modified: geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java (original)
+++ geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java Thu Aug  5 07:54:32 2010
@@ -20,6 +20,7 @@
 
 package org.apache.geronimo.bval.deployment;
 
+import java.util.Collections;
 import java.util.Map;
 
 import org.apache.geronimo.bval.DefaultValidatorFactoryReference;
@@ -33,6 +34,7 @@ import org.apache.geronimo.j2ee.j2eeobje
 import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
@@ -48,9 +50,9 @@ public class BValNamingBuilder extends A
     }
 
     @Override
-    public void buildNaming(JndiConsumer specDD, XmlObject xmlObject1, Module module, Map<EARContext.Key, Object> keyObjectMap) throws DeploymentException {
-        put("java:comp/Validator", new DefaultValidatorReference(), module.getJndiContext());
-        put("java:comp/ValidatorFactory", new DefaultValidatorFactoryReference(), module.getJndiContext());
+    public void buildNaming(JndiConsumer specDD, XmlObject xmlObject1, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
+        put("java:comp/Validator", new DefaultValidatorReference(), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
+        put("java:comp/ValidatorFactory", new DefaultValidatorFactoryReference(), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
     }
 
     @Override

Modified: geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml Thu Aug  5 07:54:32 2010
@@ -7,6 +7,11 @@
         <type>car</type>
     </module-id>
     <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm-all</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>commons-beanutils</groupId>
         <artifactId>commons-beanutils</artifactId>
         <type>jar</type>
@@ -37,6 +42,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.bundlerepository</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.geronimo.bundles</groupId>
         <artifactId>sxc-jaxb</artifactId>
         <type>jar</type>
@@ -68,6 +78,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-cli</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-core</artifactId>
         <type>jar</type>
     </dependency>
@@ -78,6 +93,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-main</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-management</artifactId>
         <type>jar</type>
     </dependency>
@@ -193,6 +213,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-saaj_1.3_spec</artifactId>
         <type>jar</type>
     </dependency>
@@ -253,6 +278,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.howl</artifactId>
         <type>jar</type>
     </dependency>
@@ -262,6 +292,16 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xstream</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.xbean</groupId>
         <artifactId>xbean-asm-shaded</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java (original)
+++ geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java Thu Aug  5 07:54:32 2010
@@ -165,7 +165,9 @@ public final class AppClientContainer im
                     }
                 }
                 if (!problems.isEmpty()) {
-                    throw new Exception("Some objects to be injected were not found in jndi: " + problems);
+                    //TODO fix the problems with trying to lookup resource refs from the client.
+//                    throw new Exception("Some objects to be injected were not found in jndi: " + problems);
+                    log.error("Some objects to be injected were not found in jndi: " + problems);
                 }
             }
             Class clazz = objectRecipe.setStaticProperties();

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -120,7 +120,7 @@ public class AdminObjectRefBuilder exten
     }
 
 
-    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map sharedContext) throws DeploymentException {
         XmlObject[] gerResourceEnvRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_ADMIN_OBJECT_REF_QNAME_SET);
         Map<String, GerResourceEnvRefType> refMap = mapResourceEnvRefs(gerResourceEnvRefsUntyped);
         Map<String, Map<String, GerMessageDestinationType>> messageDestinations = module.getRootEarContext().getMessageDestinations();
@@ -137,16 +137,15 @@ public class AdminObjectRefBuilder exten
             }
         }
 
-        Collection<ResourceEnvRef> resourceEnvRefsUntyped = specDD.getResourceEnvRef();
         List<String> unresolvedRefs = new ArrayList<String>();
         Bundle bundle = module.getEarContext().getDeploymentBundle();
-        for (ResourceEnvRef resourceEnvRef : resourceEnvRefsUntyped) {
-            String name = getStringValue(resourceEnvRef.getResourceEnvRefName());
+        for (Map.Entry<String, ResourceEnvRef> entry : specDD.getResourceEnvRefMap().entrySet()) {
+            String name = entry.getKey();
             if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
-            addInjections(name, resourceEnvRef.getInjectionTarget(), componentContext);
+            ResourceEnvRef resourceEnvRef = entry.getValue();
             String type = getStringValue(resourceEnvRef.getResourceEnvRefType());
             type = inferAndCheckType(module, bundle, resourceEnvRef.getInjectionTarget(), name, type);
             GerResourceEnvRefType gerResourceEnvRef = refMap.remove(name);
@@ -169,7 +168,7 @@ public class AdminObjectRefBuilder exten
             if (value == null) {
                 unresolvedRefs.add(name);
             } else {
-                put(name, value, module.getJndiContext());
+                put(name, value, module.getJndiContext(), resourceEnvRef.getInjectionTarget(), sharedContext);
             }
         }
 
@@ -178,15 +177,14 @@ public class AdminObjectRefBuilder exten
         }
 
         //message-destination-refs
-        Collection<MessageDestinationRef> messageDestinationRefsUntyped = specDD.getMessageDestinationRef();
 
-        for (MessageDestinationRef messageDestinationRef : messageDestinationRefsUntyped) {
-            String name = getStringValue(messageDestinationRef.getMessageDestinationRefName());
+        for (Map.Entry<String, MessageDestinationRef> entry : specDD.getMessageDestinationRefMap().entrySet()) {
+            String name = entry.getKey();
             if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
-            addInjections(name, messageDestinationRef.getInjectionTarget(), componentContext);
+            MessageDestinationRef messageDestinationRef = entry.getValue();
             String linkName = getStringValue(messageDestinationRef.getMessageDestinationLink());
             //TODO figure out something better to do here!
             if (linkName == null) {
@@ -213,7 +211,7 @@ public class AdminObjectRefBuilder exten
             }
 
             if (value != null) {
-                put(name, value, module.getJndiContext());
+                put(name, value, module.getJndiContext(), messageDestinationRef.getInjectionTarget(), sharedContext);
             }
         }
 

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -108,7 +108,7 @@ public class ResourceRefBuilder extends 
         return !specDD.getResourceRef().isEmpty();
     }
 
-    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> componentContext) throws DeploymentException {
+    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
 
         // Discover and process any @Resource annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -122,18 +122,17 @@ public class ResourceRefBuilder extends 
             }
         }
 
-        Collection<ResourceRef> resourceRefsUntyped = specDD.getResourceRef();
         XmlObject[] gerResourceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_RESOURCE_REF_QNAME_SET);
         Map<String, GerResourceRefType> refMap = mapResourceRefs(gerResourceRefsUntyped);
         List<String> unresolvedRefs = new ArrayList<String>();
         Bundle bundle = module.getEarContext().getDeploymentBundle();
-        for (ResourceRef resourceRef : resourceRefsUntyped) {
-            String name = getStringValue(resourceRef.getResRefName());
+        for (Map.Entry<String, ResourceRef> entry : specDD.getResourceRefMap().entrySet()) {
+            String name = entry.getKey();
             if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
-            addInjections(name, resourceRef.getInjectionTarget(), componentContext);
+            ResourceRef resourceRef = entry.getValue();
             String type = getStringValue(resourceRef.getResType());
             type = inferAndCheckType(module, bundle, resourceRef.getInjectionTarget(), name, type);
             GerResourceRefType gerResourceRef = refMap.get(name);
@@ -157,7 +156,7 @@ public class ResourceRefBuilder extends 
             if (value == null) {
                 unresolvedRefs.add(name);
             } else {
-                put(name, value, module.getJndiContext());
+                put(name, value, module.getJndiContext(), resourceRef.getInjectionTarget(), sharedContext);
             }
 
         }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java Thu Aug  5 07:54:32 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.datasource.d
 
 import java.sql.Connection;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,6 +43,7 @@ import org.apache.geronimo.kernel.GBeanA
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.reference.JndiReference;
 import org.apache.openejb.jee.DataSource;
+import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.IsolationLevel;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.openejb.jee.Property;
@@ -93,7 +95,7 @@ public class DataSourceBuilder extends A
         this.dataSourceQNameSet = buildQNameSet(eeNamespaces, "data-source");
     }
     
-    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
                         
         // step 1: process annotations and update deployment descriptor
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -124,7 +126,7 @@ public class DataSourceBuilder extends A
             int i = 0;
             for (DataSource dataSource: dataSources) {
                 try {
-                    addDataSourceGBean(module, componentContext, dataSource, "DataSource-" + i++);
+                    addDataSourceGBean(module, sharedContext, dataSource, "DataSource-" + i++);
                 } catch (GBeanAlreadyExistsException e) {
                     throw new DeploymentException("Error creating DataSource gbean", e);
                 }
@@ -132,7 +134,7 @@ public class DataSourceBuilder extends A
         }        
     }
 
-    private void addDataSourceGBean(Module module, Map componentContext, DataSource ds, String name)
+    private void addDataSourceGBean(Module module, Map<EARContext.Key, Object> sharedContext, DataSource ds, String name)
         throws GBeanAlreadyExistsException {
                         
         String jndiName = ds.getName();
@@ -174,7 +176,7 @@ public class DataSourceBuilder extends A
         earContext.addGBean(dataSourceGBean);
                 
         Object ref = new JndiReference("aries:services/" + osgiJndiName);
-        put(jndiName, ref, module.getJndiContext());
+        put(jndiName, ref, module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
     }
     
     private DataSource processDefinition(DataSourceDefinition dsDefinition, JndiConsumer annotatedApp) {

Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml Thu Aug  5 07:54:32 2010
@@ -23,6 +23,16 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-cli</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-main</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>j2ee-security</artifactId>
         <type>car</type>
     </dependency>
@@ -38,15 +48,50 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-ejb_3.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jaxrpc_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jpa_2.0_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-bundleutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-finder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.tranql</groupId>
         <artifactId>tranql-connector</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -18,6 +18,7 @@
 package org.apache.geronimo.corba.deployment;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -35,6 +36,7 @@ import org.apache.geronimo.kernel.reposi
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.reference.HandleDelegateReference;
 import org.apache.geronimo.naming.reference.ORBReference;
+import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
@@ -67,8 +69,8 @@ public class CorbaRefBuilder extends Abs
                 AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
                 if (corbaName != null) {
                     Artifact[] moduleId = module.getConfigId();
-                    put("java:comp/ORB", new ORBReference(moduleId, corbaName), module.getJndiContext());
-                    put("java:comp/HandleDelegate", new HandleDelegateReference(moduleId, corbaName), module.getJndiContext());
+                    put("java:comp/ORB", new ORBReference(moduleId, corbaName), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
+                    put("java:comp/HandleDelegate", new HandleDelegateReference(moduleId, corbaName), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
                 }
             }
         }

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -106,12 +106,11 @@ public class OpenEjbCorbaRefBuilder exte
         for (EjbRef ejbRef : ejbRefsUntyped) {
 
             String ejbRefName = getStringValue(ejbRef.getEjbRefName());
-            addInjections(ejbRefName, ejbRef.getInjectionTarget(), sharedContext);
             GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
 
             Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, bundle);
             if (ejbReference != null) {
-                put(ejbRefName, ejbReference, module.getJndiContext());
+                put(ejbRefName, ejbReference, module.getJndiContext(), ejbRef.getInjectionTarget(), sharedContext);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java Thu Aug  5 07:54:32 2010
@@ -32,6 +32,7 @@ import javax.ejb.Local;
 import javax.ejb.Remote;
 import org.apache.openejb.jee.EjbLocalRef;
 import org.apache.openejb.jee.EjbRef;
+import org.apache.openejb.jee.EjbReference;
 import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.openejb.jee.Text;
@@ -313,6 +314,7 @@ public final class EJBAnnotationHelper e
                     if (!descriptionAnnotation.isEmpty()) {
                         ejbLocalRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation)});
                     }
+                    ejbLocalRef.setRefType(EjbReference.Type.LOCAL);
                     annotatedApp.getEjbLocalRef().add(ejbLocalRef);
                 }
                 catch (Exception e) {
@@ -391,6 +393,7 @@ public final class EJBAnnotationHelper e
                     if (!descriptionAnnotation.isEmpty()) {
                         ejbRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation) });
                     }
+                    ejbRef.setRefType(EjbReference.Type.REMOTE);
                     annotatedApp.getEjbRef().add(ejbRef);
                 }
                 catch (Exception e) {
@@ -432,8 +435,6 @@ public final class EJBAnnotationHelper e
                     // Doesn't exist in deployment descriptor -- add as an <ejb-ref> to the
                     // ambiguous list so that it can be resolved later
                     ejbRef = new EjbRef();
-                    //TODO how to deal with this?
-//                    annotatedApp.getAmbiguousEjbRefs().add(ejbRef);
 
                     //------------------------------------------------------------------------------
                     // <ejb-ref> required elements:
@@ -471,6 +472,9 @@ public final class EJBAnnotationHelper e
                     if (!descriptionAnnotation.isEmpty()) {
                         ejbRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation) });
                     }
+                    ejbRef.setRefType(EjbReference.Type.UNKNOWN);
+                    //openejb sorts out ambiguous ejb refs.
+                    annotatedApp.getEjbRef().add(ejbRef);
                 }
                 catch (Exception e) {
                     log.debug("EJBAnnotationHelper: Exception caught while processing <UNKNOWN>", e);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/ejb-expected.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/ejb-expected.xml?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/ejb-expected.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/ejb-expected.xml Thu Aug  5 07:54:32 2010
@@ -16,11 +16,7 @@
    limitations under the License.
 -->
 
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-   version="2.5" >
-
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
     <description>Empty web application</description>
     <display-name>Empty web application</display-name>
     <ejb-ref>
@@ -31,6 +27,12 @@
         <mapped-name>mappedName1</mapped-name>
     </ejb-ref>
     <ejb-ref>
+        <description>description3</description>
+        <ejb-ref-name>EJB3</ejb-ref-name>
+        <ejb-link>beanName3</ejb-link>
+        <mapped-name>mappedName3</mapped-name>
+    </ejb-ref>
+    <ejb-ref>
         <description>description5</description>
         <ejb-ref-name>EJB5</ejb-ref-name>
         <remote>javax.ejb.EJBHome</remote>
@@ -38,6 +40,42 @@
         <mapped-name>mappedName5</mapped-name>
     </ejb-ref>
     <ejb-ref>
+        <description>description7</description>
+        <ejb-ref-name>EJB7</ejb-ref-name>
+        <ejb-link>beanName7</ejb-link>
+        <mapped-name>mappedName7</mapped-name>
+    </ejb-ref>
+    <ejb-ref>
+        <description>description11</description>
+        <ejb-ref-name>EJB11</ejb-ref-name>
+        <remote>java.lang.String</remote>
+        <ejb-link>beanName11</ejb-link>
+        <mapped-name>mappedName11</mapped-name>
+        <injection-target>
+            <injection-target-class>org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationExample</injection-target-class>
+            <injection-target-name>annotatedMethod2</injection-target-name>
+        </injection-target>
+    </ejb-ref>
+    <ejb-ref>
+        <ejb-ref-name>org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationExample/annotatedField1</ejb-ref-name>
+        <remote>java.lang.String</remote>
+        <injection-target>
+            <injection-target-class>org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationExample</injection-target-class>
+            <injection-target-name>annotatedField1</injection-target-name>
+        </injection-target>
+    </ejb-ref>
+    <ejb-ref>
+        <description>description9</description>
+        <ejb-ref-name>EJB9</ejb-ref-name>
+        <remote>java.lang.String</remote>
+        <ejb-link>beanName9</ejb-link>
+        <mapped-name>mappedName9</mapped-name>
+        <injection-target>
+            <injection-target-class>org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationExample</injection-target-class>
+            <injection-target-name>annotatedField2</injection-target-name>
+        </injection-target>
+    </ejb-ref>
+    <ejb-ref>
         <ejb-ref-name>myejb2</ejb-ref-name>
         <remote>javax.ejb.EJBHome</remote>
         <injection-target>
@@ -77,7 +115,7 @@
         <mapped-name>mappedName10</mapped-name>
         <injection-target>
             <injection-target-class>org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationExample</injection-target-class>
-            <injection-target-name>AnnotatedMethod1</injection-target-name>
+            <injection-target-name>annotatedMethod1</injection-target-name>
         </injection-target>
     </ejb-local-ref>
     <ejb-local-ref>
@@ -92,5 +130,4 @@
             <injection-target-name>annotatedField4</injection-target-name>
         </injection-target>
     </ejb-local-ref>
-
 </web-app>

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java Thu Aug  5 07:54:32 2010
@@ -189,8 +189,7 @@ public class Holder implements Serializa
             for (Injection injection : callbackHandlerinjections) {
                 try {
                     String jndiName = injection.getJndiName();
-                    //our componentContext is attached to jndi at "java:" so we remove that when looking stuff up in it
-                    Object object = context.lookup("comp/env/" + jndiName);
+                    Object object = context.lookup(jndiName);
                     objectRecipe.setProperty(injection.getTargetName(), object);
                 } catch (NamingException e) {
                     log.info("Could not look up " + injection.getJndiName(), e);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Thu Aug  5 07:54:32 2010
@@ -59,11 +59,15 @@ import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
 public abstract class AbstractNamingBuilder implements NamingBuilder {
+    private final Logger log = LoggerFactory.getLogger(AbstractNamingBuilder.class);
+
     protected static final QName BASE_NAMING_QNAME = GerAbstractNamingEntryType.type.getDocumentElementName();
     protected static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
     protected static final String JEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
@@ -140,42 +144,47 @@ public abstract class AbstractNamingBuil
      * @param key jndi name, either including java:<scope> or after java:comp/env.
      * @param value value to bind
      * @param contexts set of scopes to bind into.
+     * @param injectionTargets
+     * @param sharedContext
      */
-    protected void put(String key, Object value, Map<JndiKey, Map<String, Object>> contexts) {
-        JndiKey jndiKey;
-        if (key.startsWith("java:")) {
-            int pos = key.indexOf("/", 5);
-            String type = key.substring(5, pos);
-            jndiKey = JndiScope.valueOf(type);
-            key = key.substring(5);
-        } else {
-            key = "comp/env/" + key;
-            jndiKey = JndiScope.comp;
-        }
+    protected void put(String key, Object value, Map<JndiKey, Map<String, Object>> contexts, List<InjectionTarget> injectionTargets, Map<EARContext.Key, Object> sharedContext) {
+        key = normalize(key);
+        JndiKey jndiKey = keyFor(key);
         Map<String, Object> scope = contexts.get(jndiKey);
         if (scope == null) {
             scope = new HashMap<String, Object>();
             contexts.put(jndiKey, scope);
         }
+        log.debug("binding at name " + key + " in scope " + jndiKey + " value " + value);
         scope.put(key, value);
+        addInjections(key, injectionTargets, NamingBuilder.INJECTION_KEY.get(sharedContext));
     }
     
     protected Object lookupJndiContextMap(Module module, String key) {
-        JndiKey jndiKey;
-        if (key.startsWith("java:")) {
-            int pos = key.indexOf("/", 5);
-            String type = key.substring(5, pos);
-            jndiKey = JndiScope.valueOf(type);
-            key = key.substring(5);
-        } else {
-            key = "comp/env/" + key;
-            jndiKey = JndiScope.comp;
-        }
+        key = normalize(key);
+        JndiKey jndiKey = keyFor(key);
         Map<String, Object> scope = module.getJndiScope(jndiKey);
         if (scope == null) return null;
         return scope.get(key);
     }
 
+    protected String normalize(String name) {
+        if (name.startsWith("java:")) {
+            return name.substring("java:".length());
+        }
+        throw new IllegalArgumentException("All jndi names should start with java: not " + name);
+    }
+
+    protected JndiKey keyFor(String name) {
+        int pos = name.indexOf("/");
+        if (pos == -1) {
+            throw new IllegalArgumentException("no possible key in " + name);
+        }
+        String type = name.substring(0, pos);
+        return JndiScope.valueOf(type);
+    }
+
+
     protected String getJndiName(String name) {
         if (name.indexOf(':') != -1) {   
             return "java:comp/env/" + name;
@@ -309,9 +318,8 @@ public abstract class AbstractNamingBuil
     }
 
 
-    protected void addInjections(String jndiName, List<InjectionTarget> injectionTargetArray, Map<EARContext.Key, Object> sharedContext) {
-        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
-        for (InjectionTarget injectionTarget : injectionTargetArray) {
+    private void addInjections(String jndiName, List<InjectionTarget> injectionTargets, Holder holder) {
+        for (InjectionTarget injectionTarget : injectionTargets) {
             String targetName = injectionTarget.getInjectionTargetName().trim();
             String targetClassName = injectionTarget.getInjectionTargetClass().trim();
             holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java Thu Aug  5 07:54:32 2010
@@ -100,11 +100,11 @@ public class EnvironmentEntryBuilder ext
         }
 
         Bundle bundle = module.getEarContext().getDeploymentBundle();
-        Collection<EnvEntry> envEntriesUntyped = specDD.getEnvEntry();
         XmlObject[] gerEnvEntryUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_ENV_ENTRY_QNAME_SET);
         Map<String, String> envEntryMap = mapEnvEntries(gerEnvEntryUntyped);
-        for (EnvEntry envEntry : envEntriesUntyped) {
-            String name = getStringValue(envEntry.getEnvEntryName());
+        for (Map.Entry<String, EnvEntry> entry : specDD.getEnvEntryMap().entrySet()) {
+            String name = entry.getKey();
+            EnvEntry envEntry = entry.getValue();
             String type = getStringValue(envEntry.getEnvEntryType());
 
             Object value = null;
@@ -183,8 +183,7 @@ public class EnvironmentEntryBuilder ext
             // perform resource injection only if there is a value specified
             // see Java EE 5 spec, section EE.5.4.1.3
             if (value != null) {
-                addInjections(name, envEntry.getInjectionTarget(), sharedContext);
-                put(name, value, module.getJndiContext());
+                put(name, value, module.getJndiContext(), envEntry.getInjectionTarget(), sharedContext);
             }
         }
 
@@ -199,12 +198,17 @@ public class EnvironmentEntryBuilder ext
         if (refs != null) {
             for (XmlObject ref1 : refs) {
                 GerEnvEntryType ref = (GerEnvEntryType) ref1.copy().changeType(GerEnvEntryType.type);
-                envEntryMap.put(ref.getEnvEntryName().trim(), ref.getEnvEntryValue());
+                envEntryMap.put(gNormalize(ref.getEnvEntryName().trim()), ref.getEnvEntryValue());
             }
         }
         return envEntryMap;
     }
 
+    private String gNormalize(String s) {
+        if (s.startsWith("java:")) return s;
+        return "java:comp/env/" + s;
+    }
+
     public QNameSet getSpecQNameSet() {
         return envEntryQNameSet;
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -18,6 +18,7 @@
 package org.apache.geronimo.naming.deployment;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
@@ -36,6 +37,7 @@ import org.apache.geronimo.naming.refere
 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
@@ -90,7 +92,7 @@ public class GBeanRefBuilder extends Abs
 
             String refName = gbeanRef.getRefName();
 
-            put(refName, new GBeanReference(module.getConfigId(), queries, gBeanType), module.getJndiContext());
+            put(refName, new GBeanReference(module.getConfigId(), queries, gBeanType), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
 
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -120,15 +120,12 @@ public class SwitchingServiceRefBuilder 
             String serviceInterfaceName = serviceRef.getServiceInterface();
             Class serviceInterfaceClass = loadClass(serviceInterfaceName, bundle);
 
-            List<InjectionTarget> injections = serviceRef.getInjectionTarget();
-            addInjections(name, injections, sharedContext);
-
             if (jaxrpcClass.isAssignableFrom(serviceInterfaceClass)) {
                 // class jaxrpc handler
                 ServiceRefBuilder jaxrpcBuilder = getJAXRCPBuilder();
                 jaxrpcBuilder.buildNaming(serviceRef, gerServiceRefType, module, sharedContext);
             } else if (jaxwsClass.isAssignableFrom(serviceInterfaceClass)) {
-                // calll jaxws handler
+                // call jaxws handler
                 ServiceRefBuilder jaxwsBuilder = getJAXWSBuilder();
                 jaxwsBuilder.buildNaming(serviceRef, gerServiceRefType, module, sharedContext);
             } else {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java Thu Aug  5 07:54:32 2010
@@ -93,11 +93,15 @@ import org.apache.geronimo.web.security.
 import org.apache.geronimo.web25.deployment.merge.MergeHelper;
 import org.apache.geronimo.web25.deployment.security.AuthenticationWrapper;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
+import org.apache.openejb.jee.Filter;
 import org.apache.openejb.jee.JaxbJavaee;
+import org.apache.openejb.jee.Listener;
+import org.apache.openejb.jee.Servlet;
 import org.apache.openejb.jee.ServletMapping;
 import org.apache.openejb.jee.WebApp;
 import org.apache.xbean.finder.AbstractFinder;
 import org.apache.xbean.finder.BundleAnnotationFinder;
+import org.apache.xbean.finder.ClassFinder;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlDocumentProperties;
 import org.apache.xmlbeans.XmlObject;
@@ -162,7 +166,7 @@ public abstract class AbstractWebModuleB
         }
     };
 
-    public static final EARContext.Key<List<String>> ORDERED_LIBS = new EARContext.Key<List<String>> () {
+    public static final EARContext.Key<List<String>> ORDERED_LIBS = new EARContext.Key<List<String>>() {
         @Override
         public List<String> get(Map<EARContext.Key, Object> context) {
             return (List<String>) context.get(this);
@@ -178,9 +182,24 @@ public abstract class AbstractWebModuleB
     protected static final AbstractNameQuery STATELESS_SESSION_BEAN_PATTERN;
 
     protected static final AbstractNameQuery STATEFUL_SESSION_BEAN_PATTERN;
+    protected static final AbstractNameQuery SINGLETON_BEAN_PATTERN;
+    protected static final AbstractNameQuery MANAGED_BEAN_PATTERN;
 
     protected static final AbstractNameQuery ENTITY_BEAN_PATTERN;
 
+    protected static final AbstractNameQuery EJB_MODULE_PATTERN;
+
+    static {
+        MANAGED_CONNECTION_FACTORY_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JCA_MANAGED_CONNECTION_FACTORY));
+        ADMIN_OBJECT_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JCA_ADMIN_OBJECT));
+        STATELESS_SESSION_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.STATELESS_SESSION_BEAN));
+        STATEFUL_SESSION_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.STATEFUL_SESSION_BEAN));
+        SINGLETON_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.SINGLETON_BEAN));
+        MANAGED_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.MANAGED_BEAN));
+        ENTITY_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.ENTITY_BEAN));
+        EJB_MODULE_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.EJB_MODULE));
+    }
+
     protected final Kernel kernel;
 
     protected final NamespaceDrivenBuilderCollection serviceBuilders;
@@ -207,7 +226,7 @@ public abstract class AbstractWebModuleB
     public static final String MESSAGE_LAYER = "HttpServlet";
 
     protected AbstractWebModuleBuilder(Kernel kernel, Collection<NamespaceDrivenBuilder> serviceBuilders, NamingBuilder namingBuilders, ResourceEnvironmentSetter resourceEnvironmentSetter,
-            Collection<WebServiceBuilder> webServiceBuilder, Collection<ModuleBuilderExtension> moduleBuilderExtensions, BundleContext bundleContext) {
+                                       Collection<WebServiceBuilder> webServiceBuilder, Collection<ModuleBuilderExtension> moduleBuilderExtensions, BundleContext bundleContext) {
         this.kernel = kernel;
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
         this.namingBuilders = namingBuilders;
@@ -218,14 +237,6 @@ public abstract class AbstractWebModuleB
         packageAdmin = (PackageAdmin) bundleContext.getService(sr);
     }
 
-    static {
-        MANAGED_CONNECTION_FACTORY_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JCA_MANAGED_CONNECTION_FACTORY));
-        ADMIN_OBJECT_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JCA_ADMIN_OBJECT));
-        STATELESS_SESSION_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.STATELESS_SESSION_BEAN));
-        STATEFUL_SESSION_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.STATEFUL_SESSION_BEAN));
-        ENTITY_BEAN_PATTERN = new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.ENTITY_BEAN));
-    }
-
     public NamingBuilder getNamingBuilders() {
         return namingBuilders;
     }
@@ -236,7 +247,10 @@ public abstract class AbstractWebModuleB
         addDependencies(earContext.findGBeanDatas(earConfiguration, ADMIN_OBJECT_PATTERN), webModuleData);
         addDependencies(earContext.findGBeanDatas(earConfiguration, STATELESS_SESSION_BEAN_PATTERN), webModuleData);
         addDependencies(earContext.findGBeanDatas(earConfiguration, STATEFUL_SESSION_BEAN_PATTERN), webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, SINGLETON_BEAN_PATTERN), webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_BEAN_PATTERN), webModuleData);
         addDependencies(earContext.findGBeanDatas(earConfiguration, ENTITY_BEAN_PATTERN), webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, EJB_MODULE_PATTERN), webModuleData);
     }
 
     private void addDependencies(LinkedHashSet<GBeanData> dependencies, GBeanData webModuleData) {
@@ -253,15 +267,15 @@ public abstract class AbstractWebModuleB
 
     @Override
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, Module parentModule, Naming naming,
-            ModuleIDBuilder idBuilder) throws DeploymentException {
+                               ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, targetPath, specDDUrl, environment, (String) moduleContextInfo, parentModule, naming, idBuilder);
     }
 
     protected abstract Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, String contextRoot, Module parentModule, Naming naming,
-            ModuleIDBuilder idBuilder) throws DeploymentException;
+                                           ModuleIDBuilder idBuilder) throws DeploymentException;
 
     protected static Map<JndiKey, Map<String, Object>> shareJndi(Module parent) {
-        return Module.share(Module.APP, parent == null? null: parent.getJndiContext());
+        return Module.share(Module.APP, parent == null ? null : parent.getJndiContext());
     }
 
     /**
@@ -283,7 +297,7 @@ public abstract class AbstractWebModuleB
         for (ServletMapping servletMapping : servletMappings) {
             String servletName = servletMapping.getServletName();
             List<String> urlPatterns = servletMapping.getUrlPattern();
-            for (String urlPattern: urlPatterns) {
+            for (String urlPattern : urlPatterns) {
                 map.put(servletName, contextRoot + urlPattern);
             }
         }
@@ -452,6 +466,7 @@ public abstract class AbstractWebModuleB
         //Might need double-check !
         MergeHelper.processServletContainerInitializer(earContext, webModule, bundle);
 
+        //web.xml should now list all the classes we need to create instances of.
         //Process Web Service
         Map servletNameToPathMap = buildServletNameToPathMap(webModule.getSpecDD(), webModule.getContextRoot());
         Map sharedContext = webModule.getSharedContext();
@@ -475,6 +490,7 @@ public abstract class AbstractWebModuleB
 
     /**
      * Identify the spec DD schema version, and save it in the EARContext
+     *
      * @param originalSpecDD text of original spec dd
      * @return spec dd version
      */
@@ -612,16 +628,29 @@ public abstract class AbstractWebModuleB
         Bundle bundle = webModule.getEarContext().getDeploymentBundle();
 //        return createWebAppClassFinder(webApp, bundle);
         try {
-            return new BundleAnnotationFinder(packageAdmin, bundle);
+            LinkedHashSet<Class<?>> classes = new LinkedHashSet<Class<?>>();
+            for (Servlet servlet : webApp.getServlet()) {
+                if (servlet.getServletClass() != null) {
+                    addClass(bundle, classes, servlet.getServletClass());
+                }
+            }
+            for (Filter filter : webApp.getFilter()) {
+                addClass(bundle, classes, filter.getFilterClass());
+            }
+            for (Listener listener : webApp.getListener()) {
+                addClass(bundle, classes, listener.getListenerClass());
+            }
+            return new ClassFinder(new ArrayList<Class>(classes));
         } catch (Exception e) {
             throw new DeploymentException(e);
         }
     }
 
-    private static void addClass(List<Class> classes, Class<?> clas) {
-        while (clas != Object.class) {
-            classes.add(clas);
-            clas = clas.getSuperclass();
+    private void addClass(Bundle bundle, LinkedHashSet<Class<?>> classes, String className) throws ClassNotFoundException {
+        Class<?> cl = bundle.loadClass(className);
+        while (cl != Object.class) {
+            classes.add(cl);
+            cl = cl.getSuperclass();
         }
     }
 

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml Thu Aug  5 07:54:32 2010
@@ -27,8 +27,33 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.howl</artifactId>
         <type>jar</type>
     </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-bundleutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-finder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-reflect</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java Thu Aug  5 07:54:32 2010
@@ -181,8 +181,8 @@ public class JspModuleBuilderExtension i
 
     protected ClassFinder createJspClassFinder(WebApp webApp, WebModule webModule, Set<String> listenerNames) throws DeploymentException {
         Collection<URL> urls = getTldFiles(webApp, webModule);
-        List<Class> classes = getListenerClasses(webApp, webModule, urls, listenerNames);
-        return new ClassFinder(classes);
+        LinkedHashSet<Class> classes = getListenerClasses(webApp, webModule, urls, listenerNames);
+        return new ClassFinder(new ArrayList<Class>(classes));
     }
 
 
@@ -286,7 +286,7 @@ public class JspModuleBuilderExtension i
         return tldURLs;
     }
     
-    private List<Class> getListenerClasses(WebApp webApp, WebModule webModule, Collection<URL> urls, Set<String> listenerNames) throws DeploymentException {
+    private LinkedHashSet<Class> getListenerClasses(WebApp webApp, WebModule webModule, Collection<URL> urls, Set<String> listenerNames) throws DeploymentException {
         if (log.isDebugEnabled()) {
             log.debug("getListenerClasses( " + webApp.toString() + "," + '\n' +
                     webModule.getName() + " ): Entry");
@@ -294,7 +294,7 @@ public class JspModuleBuilderExtension i
 
         // Get the classloader from the module's EARContext
         Bundle bundle = webModule.getEarContext().getDeploymentBundle();
-        List<Class> classes = new ArrayList<Class>();
+        LinkedHashSet<Class> classes = new LinkedHashSet<Class>();
 
         for (URL url : urls) {
             parseTldFile(url, bundle, classes, listenerNames);
@@ -306,7 +306,7 @@ public class JspModuleBuilderExtension i
         return classes;
     }
 
-    private void parseTldFile(URL url, Bundle bundle, List<Class> classes, Set<String> listenerNames) throws DeploymentException {
+    private void parseTldFile(URL url, Bundle bundle, LinkedHashSet<Class> classes, Set<String> listenerNames) throws DeploymentException {
         log.debug("parseTLDFile( " + url.toString() + " ): Entry");
 
         try {
@@ -325,7 +325,10 @@ public class JspModuleBuilderExtension i
                 if (!excludedListenerNames.contains(className)) {
                     try {
                         Class clas = bundle.loadClass(className);
-                        classes.add(clas);
+                        while (clas != null) {
+                            classes.add(clas);
+                            clas = clas.getSuperclass();
+                        }
                         listenerNames.add(className);
                     }
                     catch (ClassNotFoundException e) {
@@ -340,7 +343,10 @@ public class JspModuleBuilderExtension i
                 String className = tag.getTagClass();
                 try {
                     Class clas = bundle.loadClass(className);
-                    classes.add(clas);
+                    while (clas != null) {
+                        classes.add(clas);
+                        clas = clas.getSuperclass();
+                    }
                 }
                 catch (ClassNotFoundException e) {
                     log.warn("JspModuleBuilderExtension: Could not load tag class: " + className + " mentioned in TLD file at " + url.toString());

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java Thu Aug  5 07:54:32 2010
@@ -78,7 +78,6 @@ public abstract class JAXWSServiceRefBui
 
         for (ServiceRef serviceRef : serviceRefsUntyped) {
             String name = getStringValue(serviceRef.getServiceRefName());
-            addInjections(name, serviceRef.getInjectionTarget(), componentContext);
             GerServiceRefType serviceRefType = serviceRefMap.remove(name);
             buildNaming(serviceRef, serviceRefType, module, componentContext);
         }
@@ -97,9 +96,10 @@ public abstract class JAXWSServiceRefBui
     }
 
     @Override
-    public void buildNaming(ServiceRef serviceRef, GerServiceRefType gerServiceRef, Module module, Map<EARContext.Key, Object> componentContext) throws DeploymentException {
+    public void buildNaming(ServiceRef serviceRef, GerServiceRefType gerServiceRef, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         Bundle bundle = module.getEarContext().getDeploymentBundle();
-        String name = getStringValue(serviceRef.getServiceRefName());
+        //TODO normalize or use normalized name from jee's map
+        String name = normalize(getStringValue(serviceRef.getServiceRefName()));
 
         String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
         Class serviceInterfaceClass = loadClass(serviceInterfaceName, bundle, "service");
@@ -151,7 +151,7 @@ public abstract class JAXWSServiceRefBui
         Object ref = createService(serviceRef, gerServiceRef, module, bundle,
                                    serviceInterfaceClass, serviceQName,
                                    wsdlURI, serviceReferenceType, portComponentRefMap);
-        put(name, ref, module.getJndiContext());
+        put(name, ref, module.getJndiContext(), serviceRef.getInjectionTarget(), sharedContext);
     }
 
     public abstract Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef,

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=982493&r1=982492&r2=982493&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java Thu Aug  5 07:54:32 2010
@@ -23,6 +23,7 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
@@ -184,8 +185,8 @@ public class MyFacesModuleBuilderExtensi
 
     protected ClassFinder createMyFacesClassFinder(WebApp webApp, WebModule webModule) throws DeploymentException {
 
-        List<Class> classes = getFacesClasses(webApp, webModule);
-        return new ClassFinder(classes);
+        LinkedHashSet<Class> classes = getFacesClasses(webApp, webModule);
+        return new ClassFinder(new ArrayList<Class>(classes));
     }
 
 
@@ -210,7 +211,7 @@ public class MyFacesModuleBuilderExtensi
      * @throws org.apache.geronimo.common.DeploymentException
      *          if a faces-config.xml file is located but cannot be parsed.
      */
-    private List<Class> getFacesClasses(WebApp webApp, WebModule webModule) throws DeploymentException {
+    private LinkedHashSet<Class> getFacesClasses(WebApp webApp, WebModule webModule) throws DeploymentException {
         log.debug("getFacesClasses( " + webApp.toString() + "," + '\n' +
                 (webModule != null ? webModule.getName() : null) + " ): Entry");
 
@@ -218,7 +219,7 @@ public class MyFacesModuleBuilderExtensi
         Bundle bundle = webModule.getEarContext().getDeploymentBundle();
 
         // 1. META-INF/faces-config.xml
-        List<Class> classes = new ArrayList<Class>();
+        LinkedHashSet<Class> classes = new LinkedHashSet<Class>();
         URL url = deployable.getResource("META-INF/faces-config.xml");
         if (url != null) {
             parseConfigFile(url, bundle, classes);
@@ -258,7 +259,7 @@ public class MyFacesModuleBuilderExtensi
         return classes;
     }
 
-    private void parseConfigFile(URL url, Bundle bundle, List<Class> classes) throws DeploymentException {
+    private void parseConfigFile(URL url, Bundle bundle, LinkedHashSet<Class> classes) throws DeploymentException {
         log.debug("parseConfigFile( " + url.toString() + " ): Entry");
 
         try {
@@ -277,8 +278,10 @@ public class MyFacesModuleBuilderExtensi
                 Class<?> clas;
                 try {
                     clas = bundle.loadClass(className);
-                    classes.add(clas);
-                    //TODO do we need superclasses?
+                    while (clas != null) {
+                        classes.add(clas);
+                        clas = clas.getSuperclass();
+                    }
                 }
                 catch (ClassNotFoundException e) {
                     log.warn("MyFacesModuleBuilderExtension: Could not load managed bean class: " + className + " mentioned in faces-config.xml file at " + url.toString());



Mime
View raw message