geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 47139 - in geronimo/trunk/modules: client-builder/src/java/org/apache/geronimo/client/builder client-builder/src/schema connector/src/java/org/apache/geronimo/connector/deployment connector/src/test/org/apache/geronimo/connector connector/src/test/org/apache/geronimo/connector/outbound deployment/src/java/org/apache/geronimo/deployment j2ee-schema/src/java/org/apache/geronimo/schema j2ee-schema/src/test-data/geronimo j2ee-schema/src/test/org/apache/geronimo/schema j2ee/src/java/org/apache/geronimo/j2ee/deployment j2ee/src/test/org/apache/geronimo/j2ee/deployment jetty/src/java/org/apache/geronimo/jetty/deployment jetty/src/schema naming naming/src/java/org/apache/geronimo/naming naming/src/java/org/apache/geronimo/naming/deployment naming/src/java/org/apache/geronimo/naming/java naming/src/java/org/apache/geronimo/naming/jmx naming/src/schema naming/src/test/org/apache/geronimo/naming/java
Date Fri, 24 Sep 2004 07:08:12 GMT
Author: djencks
Date: Fri Sep 24 00:08:10 2004
New Revision: 47139

Added:
   geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/
   geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml
   geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml
Removed:
   geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientRefAdapter.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyRefAdapter.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/RefAdapter.java
Modified:
   geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
   geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd
   geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml
   geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
   geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
   geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java
   geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd
   geronimo/trunk/modules/naming/maven.xml
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCHelper.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/LocalRefDConfigBean.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/RemoteRefDConfigBean.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
   geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd
   geronimo/trunk/modules/naming/src/schema/xmlconfig.xml
   geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
Log:
Use xmlbeans namespace addition to put geronimo naming dd info in its own namespace without requiring users to include the namespace.  Remove RefAdapter.  Clean up exceptions in dd processing

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	Fri Sep 24 00:08:10 2004
@@ -58,17 +58,17 @@
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
+import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientDocument;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType;
 import org.apache.geronimo.xbeans.geronimo.client.GerDependencyType;
 import org.apache.geronimo.xbeans.geronimo.client.GerGbeanType;
-import org.apache.geronimo.xbeans.geronimo.client.GerRemoteRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 import org.apache.geronimo.xbeans.j2ee.ApplicationClientDocument;
 import org.apache.geronimo.xbeans.j2ee.ApplicationClientType;
 import org.apache.geronimo.xbeans.j2ee.EjbLocalRefType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 import org.apache.xmlbeans.XmlBeans;
-import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
 
@@ -124,7 +124,7 @@
         }
     }
 
-    public XmlObject getDeploymentPlan(URL module) throws XmlException {
+    public XmlObject getDeploymentPlan(URL module) throws DeploymentException {
         try {
             URL moduleBase;
             if (module.toString().endsWith("/")) {
@@ -142,8 +142,14 @@
         }
     }
 
-    public XmlObject parseVendorDD(URL url) throws XmlException {
-        return XmlBeansUtil.getXmlObject(url, GerApplicationClientDocument.type);
+    public XmlObject parseVendorDD(URL path) throws DeploymentException {
+        try {
+            XmlObject dd = SchemaConversionUtils.parse(path.openStream());
+            dd = SchemaConversionUtils.convertToGeronimoNamingSchema(dd);
+            return dd.changeType(GerApplicationClientDocument.type);
+        } catch (Exception e) {
+            throw new DeploymentException(e);
+        }
     }
 
     private GerApplicationClientDocument createDefaultPlan(URL moduleBase) {
@@ -446,7 +452,7 @@
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerRemoteRefType ref = refs[i];
-                refMap.put(ref.getRefName(), new AppClientRefAdapter(ref));
+                refMap.put(ref.getRefName(), ref);
             }
         }
         return refMap;

Modified: geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd
==============================================================================
--- geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd	(original)
+++ geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd	Fri Sep 24 00:08:10 2004
@@ -19,12 +19,14 @@
 <xs:schema
     xmlns:geronimo="http://geronimo.apache.org/xml/ns/j2ee/application-client"
     targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/application-client"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">
 
-    <xs:include schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming" schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
+    <!--xs:include schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/-->
     <xs:include schemaLocation="../../../deployment/src/schema/geronimo-common.xsd"/>
 
     <xs:element name="application-client" type="geronimo:application-clientType"/>
@@ -39,18 +41,19 @@
             <!--                type="geronimo:fully-qualified-classType"-->
             <!--                minOccurs="0"/>-->
 
-            <xs:element name="ejb-ref"
-                type="geronimo:remote-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
-            <xs:element name="resource-ref"
-                type="geronimo:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
-            <xs:element name="resource-env-ref"
-                type="geronimo:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
-            <xs:element name="message-destination-ref"
-                type="geronimo:remote-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <!--xs:element name="ejb-ref"
+               type="geronimo:remote-refType"
+               minOccurs="0" maxOccurs="unbounded"/>
+           <xs:element name="resource-ref"
+               type="geronimo:local-refType"
+               minOccurs="0" maxOccurs="unbounded"/>
+           <xs:element name="resource-env-ref"
+               type="geronimo:local-refType"
+               minOccurs="0" maxOccurs="unbounded"/>
+           <xs:element name="message-destination-ref"
+               type="geronimo:remote-refType"
+               minOccurs="0" maxOccurs="unbounded"/-->
 
             <xs:element name="gbean" type="geronimo:gbeanType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>

Modified: geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml
==============================================================================
--- geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml	(original)
+++ geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml	Fri Sep 24 00:08:10 2004
@@ -24,8 +24,12 @@
     </xb:namespace>
 
     <!--this should be unnecessary.  Probably needs xmlbeans plugin to reuse the naming classes rather than generating duplicates-->
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee">
-        <xb:package>org.apache.geronimo.xbeans.geronimo</xb:package>
+    <!--xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee">
+         <xb:package>org.apache.geronimo.xbeans.geronimo</xb:package>
+         <xb:prefix>Ger</xb:prefix>
+     </xb:namespace-->
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.naming</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java	(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java	Fri Sep 24 00:08:10 2004
@@ -137,11 +137,16 @@
         throw new DeploymentException("Unable to parse specDD");
     }
 
-    public XmlObject parseVendorDD(URL url) throws XmlException {
-        return XmlBeansUtil.getXmlObject(url, GerConnectorDocument.type);
+    public XmlObject parseVendorDD(URL path) throws DeploymentException {
+        try {
+             XmlObject dd = SchemaConversionUtils.parse(path.openStream());
+             return dd.changeType(GerConnectorDocument.type);
+         } catch (Exception e) {
+             throw new DeploymentException(e);
+         }
     }
 
-    public XmlObject getDeploymentPlan(URL module) throws XmlException {
+    public XmlObject getDeploymentPlan(URL module) throws DeploymentException {
         try {
             URL moduleBase;
             if (module.toString().endsWith("/")) {

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java	(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java	Fri Sep 24 00:08:10 2004
@@ -28,12 +28,11 @@
 import org.apache.geronimo.connector.mock.MockAdminObjectImpl;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.naming.deployment.RefAdapter;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
 import org.apache.geronimo.naming.ReferenceFactory;
-import org.apache.xmlbeans.XmlObject;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 
 /**
  * @version $Rev$ $Date$
@@ -92,50 +91,11 @@
     public void testLocalLookup() throws Exception {
         ReferenceFactory referenceFactory = new JMXReferenceFactory();
         ComponentContextBuilder builder = new ComponentContextBuilder(referenceFactory);
-        builder.addResourceEnvRef("resourceenvref", MockAdminObject.class, new RefAdapter() {
-            public XmlObject getXmlObject() {
-                return null;
-            }
-
-            public void setXmlObject(XmlObject xmlObject) {
-            }
-
-            public String getRefName() {
-                return "resourceenvref";
-            }
-
-            public void setRefName(String name) {
-            }
-
-            public String getServerName() {
-                return null;
-            }
-
-            public void setServerName(String serverName) {
-            }
-
-            public String getKernelName() {
-                return KERNEL_NAME;
-            }
-
-            public void setKernelName(String kernelName) {
-            }
-
-            public String getTargetName() {
-                return TARGET_NAME;
-            }
-
-            public void setTargetName(String targetName) {
-            }
-
-            public String getExternalUri() {
-                return null;
-            }
-
-            public void setExternalUri(String externalURI) {
-            }
-
-        });
+        GerLocalRefType localRef = GerLocalRefType.Factory.newInstance();
+        localRef.setRefName("resourceenvref");
+        localRef.setKernelName(KERNEL_NAME);
+        localRef.setTargetName(TARGET_NAME);
+        builder.addResourceEnvRef("resourceenvref", MockAdminObject.class, localRef);
         ReadOnlyContext roc = builder.getContext();
         Object o = roc.lookup("env/resourceenvref");
         assertNotNull(o);

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java	(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java	Fri Sep 24 00:08:10 2004
@@ -41,11 +41,11 @@
 import org.apache.geronimo.gbean.GBeanInfoFactory;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.naming.deployment.RefAdapter;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
 import org.apache.geronimo.naming.ReferenceFactory;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -127,50 +127,11 @@
     public void testLocalLookup() throws Exception {
         ReferenceFactory referenceFactory = new JMXReferenceFactory();
         ComponentContextBuilder builder = new ComponentContextBuilder(referenceFactory);
-        builder.addResourceRef("resourceref", ConnectionFactory.class, new RefAdapter() {
-            public XmlObject getXmlObject() {
-                return null;
-            }
-
-            public void setXmlObject(XmlObject xmlObject) {
-            }
-
-            public String getRefName() {
-                return "resourceref";
-            }
-
-            public void setRefName(String name) {
-            }
-
-            public String getServerName() {
-                return null;
-            }
-
-            public void setServerName(String serverName) {
-            }
-
-            public String getKernelName() {
-                return KERNEL_NAME;
-            }
-
-            public void setKernelName(String kernelName) {
-            }
-
-            public String getTargetName() {
-                return TARGET_NAME;
-            }
-
-            public void setTargetName(String targetName) {
-            }
-
-            public String getExternalUri() {
-                return null;
-            }
-
-            public void setExternalUri(String externalURI) {
-            }
-
-        });
+        GerLocalRefType localRef = GerLocalRefType.Factory.newInstance();
+        localRef.setRefName("resourceref");
+        localRef.setKernelName(KERNEL_NAME);
+        localRef.setTargetName(TARGET_NAME);
+        builder.addResourceRef("resourceref", ConnectionFactory.class, localRef);
         ReadOnlyContext roc = builder.getContext();
         Object o = roc.lookup("env/resourceref");
         assertNotNull(o);

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java	Fri Sep 24 00:08:10 2004
@@ -23,7 +23,6 @@
 import java.util.jar.Manifest;
 
 import org.apache.xmlbeans.SchemaTypeLoader;
-import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -47,7 +46,7 @@
      * @param module the URL of the module to examine
      * @return the deployment plan, or null if this module can not handle it
      */
-    XmlObject getDeploymentPlan(URL module) throws XmlException;
+    XmlObject getDeploymentPlan(URL module) throws DeploymentException;
 
     /**
      * Build a configuration from a local file

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java	Fri Sep 24 00:08:10 2004
@@ -94,11 +94,7 @@
             }
             for (Iterator i = builders.iterator(); i.hasNext();) {
                 ConfigurationBuilder candidate = (ConfigurationBuilder) i.next();
-                try {
-                    plan = candidate.getDeploymentPlan(moduleURL);
-                } catch (XmlException e) {
-                    throw new DeploymentException(e);
-                }
+                plan = candidate.getDeploymentPlan(moduleURL);
                 if (plan != null) {
                     builder = candidate;
                     break;

Modified: geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java	(original)
+++ geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java	Fri Sep 24 00:08:10 2004
@@ -36,7 +36,11 @@
  * @version $Rev$ $Date$
  */
 public class SchemaConversionUtils {
-    private static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+
+    static final String GERONIMO_NAMING_NAMESPACE = "http://geronimo.apache.org/xml/ns/naming";
+    static final String GERONIMO_NAMING_NAMESPACE_L0CATION = "http://geronimo.apache.org/xml/ns/naming_1_4.xsd";
+    private static final QName TAGLIB = new QName(J2EE_NAMESPACE, "taglib");
 
     private SchemaConversionUtils() {
     }
@@ -75,7 +79,7 @@
         String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd";
         String version = "1.4";
         try {
-            convertToSchema(cursor, schemaLocationURL, version);
+            convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
             cursor.toStartDoc();
             cursor.toChild(J2EE_NAMESPACE, "application");
             cursor.toFirstChild();
@@ -94,6 +98,29 @@
 
     }
 
+    public static ApplicationClientDocument convertToApplicationClientSchema(XmlObject xmlObject) throws XmlException {
+        if (ApplicationClientDocument.type.equals(xmlObject.schemaType())) {
+            validateDD(xmlObject);
+            return (ApplicationClientDocument) xmlObject;
+        }
+        XmlCursor cursor = xmlObject.newCursor();
+        String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd";
+        String version = "1.4";
+        try {
+            convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
+        } finally {
+            cursor.dispose();
+        }
+        XmlObject result = xmlObject.changeType(ApplicationDocument.type);
+        if (result != null) {
+            validateDD(result);
+            return (ApplicationClientDocument) result;
+        }
+        validateDD(xmlObject);
+        return (ApplicationClientDocument) xmlObject;
+
+    }
+
     public static EjbJarDocument convertToEJBSchema(XmlObject xmlObject) throws XmlException {
         if (EjbJarDocument.type.equals(xmlObject.schemaType())) {
             validateDD(xmlObject);
@@ -104,7 +131,7 @@
         String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";
         String version = "2.1";
         try {
-            convertToSchema(cursor, schemaLocationURL, version);
+            convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
             //play with message-driven
             cursor.toStartDoc();
             convertBeans(cursor, moveable);
@@ -131,19 +158,18 @@
         String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
         String version = "2.4";
         try {
-            convertToSchema(cursor, schemaLocationURL, version);
+            convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
             cursor.toStartDoc();
             cursor.toChild(J2EE_NAMESPACE, "web-app");
             cursor.toFirstChild();
             convertToDescriptionGroup(cursor, moveable);
             convertToJNDIEnvironmentRefsGroup(cursor, moveable);
             cursor.push();
-            QName taglib = new QName(J2EE_NAMESPACE, "taglib");
-            if (cursor.toNextSibling(taglib)) {
+            if (cursor.toNextSibling(TAGLIB)) {
                 cursor.toPrevSibling();
                 moveable.toCursor(cursor);
                 cursor.beginElement("jsp-config", J2EE_NAMESPACE);
-                while (moveable.toNextSibling(taglib)) {
+                while (moveable.toNextSibling(TAGLIB)) {
                     moveable.moveXml(cursor);
                 }
             }
@@ -175,28 +201,45 @@
         return (WebAppDocument) xmlObject;
     }
 
-    public static ApplicationClientDocument convertToApplicationClientSchema(XmlObject xmlObject) throws XmlException {
-//        if (ApplicationClientDocument.type.equals(xmlObject.schemaType())) {
-//            validateDD(xmlObject);
-            return (ApplicationClientDocument) xmlObject;
-//        }
-//        throw new UnsupportedOperationException("Deployment of previous version of application not supported");
+    public static XmlObject convertToGeronimoNamingSchema(XmlObject xmlObject) {
+        XmlCursor cursor = xmlObject.newCursor();
+	XmlCursor end = xmlObject.newCursor();
+        String version = "1.0";
+        try {
+            while (cursor.hasNextToken()) {
+                if (cursor.isStart()) {
+                    String localName = cursor.getName().getLocalPart();
+                    if (localName.equals("ejb-ref")
+                        || localName.equals("ejb-local-ref")
+                        || localName.equals("resource-ref")
+                        || localName.equals("resource-env-ref")) {
+                        convertElementToSchema(cursor, end, GERONIMO_NAMING_NAMESPACE, GERONIMO_NAMING_NAMESPACE_L0CATION, version);
+                    }
+		}
+	        cursor.toNextToken();
+            }
+        } finally {
+            cursor.dispose();
+        }
+        return xmlObject;
+
     }
 
-    public static boolean convertToSchema(XmlCursor cursor, String schemaLocationURL, String version) {
+
+    public static boolean convertToSchema(XmlCursor cursor, String namespace, String schemaLocationURL, String version) {
         //convert namespace
         boolean isFirstStart = true;
         while (cursor.hasNextToken()) {
             if (cursor.isStart()) {
-                if (J2EE_NAMESPACE.equals(cursor.getName().getNamespaceURI())) {
+                if (namespace.equals(cursor.getName().getNamespaceURI())) {
                     //already has correct schema, exit
                     return false;
                 }
-                cursor.setName(new QName(J2EE_NAMESPACE, cursor.getName().getLocalPart()));
+                cursor.setName(new QName(namespace, cursor.getName().getLocalPart()));
                 cursor.toNextToken();
                 if (isFirstStart) {
                     cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
-                    cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation", "xsi"), "http://java.sun.com/xml/ns/j2ee " + schemaLocationURL);
+                    cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation", "xsi"), namespace + schemaLocationURL);
                     cursor.insertAttributeWithValue(new QName("version"), version);
                     isFirstStart = false;
                 }
@@ -207,6 +250,30 @@
         return true;
     }
 
+    public static boolean convertElementToSchema(XmlCursor cursor, XmlCursor end, String namespace, String schemaLocationURL, String version) {
+        //convert namespace
+	//        boolean isFirstStart = true;
+	end.toCursor(cursor);
+	end.toEndToken();
+        while (cursor.hasNextToken() && cursor.isLeftOf(end)) {
+            if (cursor.isStart()) {
+                if (namespace.equals(cursor.getName().getNamespaceURI())) {
+                    //already has correct schema, exit
+                    return false;
+                }
+                cursor.setName(new QName(namespace, cursor.getName().getLocalPart()));
+                cursor.toNextToken();
+		//      if (isFirstStart) {
+		    //                    cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation", "xsi"), namespace + " " + schemaLocationURL);
+		//  isFirstStart = false;
+                //}
+            } else {
+                cursor.toNextToken();
+            }
+        }
+        return true;
+    }
+
     public static void convertBeans(XmlCursor cursor, XmlCursor moveable) {
         cursor.toChild(J2EE_NAMESPACE, "ejb-jar");
         cursor.toChild(J2EE_NAMESPACE, "enterprise-beans");
@@ -334,7 +401,7 @@
         Collection errors = new ArrayList();
         xmlOptions.setErrorListener(errors);
         if (!dd.validate(xmlOptions)) {
-            throw new XmlException("Invalid deployment descriptor: " + errors, null, errors);
+            throw new XmlException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + dd.toString(), null, errors);
         }
     }
 

Added: geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml	Fri Sep 24 00:08:10 2004
@@ -0,0 +1,214 @@
+<?xml version="1.0"?>
+
+<openejb-jar configId="org/openejb/Itests" parentId="org/apache/geronimo/DefaultDatabase" xmlns="http://www.openejb.org/xml/ns/openejb-jar" xmlns:nam="http://geronimo.apache.org/xml/ns/naming">
+  <dependency>
+    <uri>junit/jars/junit-3.8.jar</uri>
+  </dependency>
+  <cmp-connection-factory>DefaultDatasource</cmp-connection-factory>
+  <enterprise-beans>
+    <!--
+        ########################################################
+        Stateless
+        ########################################################
+        -->
+    <session>
+      <ejb-name>BasicStatelessBean</ejb-name>
+      <jndi-name>client/tests/stateless/BasicStatelessHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>stateless/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>BasicBMTStatelessBean</ejb-name>
+      <jndi-name>client/tests/stateless/BeanManagedBasicStatelessHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>stateless/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>DatabaseBean</ejb-name>
+      <jndi-name>client/tools/DatabaseHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>database</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>BMTStatelessBean</ejb-name>
+      <jndi-name>client/tests/stateless/BeanManagedTransactionTests/EJBHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>database</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>EncStatelessBean</ejb-name>
+      <jndi-name>client/tests/stateless/EncBean</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>datasource</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>StatelessRMIIIOPBean</ejb-name>
+      <jndi-name>client/tests/stateless/RMI-over-IIOP/EJBHome</jndi-name>
+    </session>
+    <!--
+        ########################################################
+        Stateless
+        ########################################################
+        -->
+    <session>
+      <ejb-name>BasicStatefulBean</ejb-name>
+      <jndi-name>client/tests/stateful/BasicStatefulHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>stateful/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>BasicBMTStatefulBean</ejb-name>
+      <jndi-name>client/tests/stateful/BeanManagedBasicStatefulHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>stateful/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>BMTStatefulBean</ejb-name>
+      <jndi-name>client/tests/stateful/BeanManagedTransactionTests/EJBHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>datasource</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>EncStatefulBean</ejb-name>
+      <jndi-name>client/tests/stateful/EncBean</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>datasource</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </session>
+    <session>
+      <ejb-name>StatefulRMIIIOPBean</ejb-name>
+      <jndi-name>client/tests/stateful/RMI-over-IIOP/EJBHome</jndi-name>
+    </session>
+    <!--
+        ########################################################
+        BMP
+        ########################################################
+        -->
+    <entity>
+      <ejb-name>BasicBmpBean</ejb-name>
+      <jndi-name>client/tests/entity/bmp/BasicBmpHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>AOBasicBmpBean</ejb-name>
+      <jndi-name>client/tests/entity/bmp/allowed_operations/EntityHome</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+      <nam:resource-ref>
+        <nam:ref-name>entity/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>EncBmpBean</ejb-name>
+      <jndi-name>client/tests/entity/bmp/EncBean</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>datasource</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>BmpRMIIIOPBean</ejb-name>
+      <jndi-name>client/tests/entity/bmp/RMI-over-IIOP/EJBHome</jndi-name>
+    </entity>
+    <!--
+        ########################################################
+        BMP
+        ########################################################
+        -->
+    <entity>
+      <ejb-name>BasicCmpBean</ejb-name>
+      <jndi-name>client/tests/entity/cmp/BasicCmpHome</jndi-name>
+      <query>
+        <query-method>
+          <method-name>findByLastName</method-name>
+          <method-params>
+            <method-param>java.lang.String</method-param>
+          </method-params>
+        </query-method>
+        <sql>SELECT id FROM BasicCmp WHERE lastName = ?</sql>
+      </query>
+      <query>
+        <query-method>
+          <method-name>findEmptyCollection</method-name>
+          <method-params/>
+        </query-method>
+        <sql>SELECT id FROM BasicCmp WHERE 1 = 0</sql>
+      </query>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>AOBasicCmpBean</ejb-name>
+      <jndi-name>client/tests/entity/cmp/allowed_operations/EntityHome</jndi-name>
+      <query>
+        <query-method>
+          <method-name>findByLastName</method-name>
+          <method-params>
+            <method-param>java.lang.String</method-param>
+          </method-params>
+        </query-method>
+        <sql>SELECT id FROM AOBasicCmp WHERE lastName = ?</sql>
+      </query>
+      <query>
+        <query-method>
+          <method-name>findEmptyCollection</method-name>
+          <method-params/>
+        </query-method>
+        <sql>SELECT id FROM AOBasicCmp WHERE 1 = 0</sql>
+      </query>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+      <nam:resource-ref>
+        <nam:ref-name>entity/references/Resource_manager_access</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>EncCmpBean</ejb-name>
+      <jndi-name>client/tests/entity/cmp/EncBean</jndi-name>
+      <nam:resource-ref>
+        <nam:ref-name>jdbc/basic/entityDatabase</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+      <nam:resource-ref>
+        <nam:ref-name>datasource</nam:ref-name>
+        <nam:target-name>DefaultDatasource</nam:target-name>
+      </nam:resource-ref>
+    </entity>
+    <entity>
+      <ejb-name>CmpRMIIIOPBean</ejb-name>
+      <jndi-name>client/tests/entity/cmp/RMI-over-IIOP/EJBHome</jndi-name>
+    </entity>
+  </enterprise-beans>
+</openejb-jar>

Added: geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml	Fri Sep 24 00:08:10 2004
@@ -0,0 +1,227 @@
+<?xml version="1.0"?>
+
+<openejb-jar
+    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
+    configId="org/openejb/Itests"
+    parentId="org/apache/geronimo/DefaultDatabase">
+
+    <dependency>
+        <uri>junit/jars/junit-3.8.jar</uri>
+    </dependency>
+
+    <cmp-connection-factory>DefaultDatasource</cmp-connection-factory>
+
+    <enterprise-beans>
+        <!--
+        ########################################################
+        Stateless
+        ########################################################
+        -->
+        <session>
+            <ejb-name>BasicStatelessBean</ejb-name>
+            <jndi-name>client/tests/stateless/BasicStatelessHome</jndi-name>
+            <resource-ref>
+                <ref-name>stateless/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>BasicBMTStatelessBean</ejb-name>
+            <jndi-name>client/tests/stateless/BeanManagedBasicStatelessHome</jndi-name>
+            <resource-ref>
+                <ref-name>stateless/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>DatabaseBean</ejb-name>
+            <jndi-name>client/tools/DatabaseHome</jndi-name>
+            <resource-ref>
+                <ref-name>database</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>BMTStatelessBean</ejb-name>
+            <jndi-name>client/tests/stateless/BeanManagedTransactionTests/EJBHome</jndi-name>
+            <resource-ref>
+                <ref-name>database</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>EncStatelessBean</ejb-name>
+            <jndi-name>client/tests/stateless/EncBean</jndi-name>
+            <resource-ref>
+                <ref-name>datasource</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>StatelessRMIIIOPBean</ejb-name>
+            <jndi-name>client/tests/stateless/RMI-over-IIOP/EJBHome</jndi-name>
+        </session>
+
+
+
+        <!--
+        ########################################################
+        Stateless
+        ########################################################
+        -->
+        <session>
+            <ejb-name>BasicStatefulBean</ejb-name>
+            <jndi-name>client/tests/stateful/BasicStatefulHome</jndi-name>
+            <resource-ref>
+                <ref-name>stateful/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>BasicBMTStatefulBean</ejb-name>
+            <jndi-name>client/tests/stateful/BeanManagedBasicStatefulHome</jndi-name>
+            <resource-ref>
+                <ref-name>stateful/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>BMTStatefulBean</ejb-name>
+            <jndi-name>client/tests/stateful/BeanManagedTransactionTests/EJBHome</jndi-name>
+            <resource-ref>
+                <ref-name>datasource</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>EncStatefulBean</ejb-name>
+            <jndi-name>client/tests/stateful/EncBean</jndi-name>
+            <resource-ref>
+                <ref-name>datasource</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </session>
+        <session>
+            <ejb-name>StatefulRMIIIOPBean</ejb-name>
+            <jndi-name>client/tests/stateful/RMI-over-IIOP/EJBHome</jndi-name>
+        </session>
+
+        <!--
+        ########################################################
+        BMP
+        ########################################################
+        -->
+        <entity>
+            <ejb-name>BasicBmpBean</ejb-name>
+            <jndi-name>client/tests/entity/bmp/BasicBmpHome</jndi-name>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>AOBasicBmpBean</ejb-name>
+            <jndi-name>client/tests/entity/bmp/allowed_operations/EntityHome</jndi-name>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+            <resource-ref>
+                <ref-name>entity/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>EncBmpBean</ejb-name>
+            <jndi-name>client/tests/entity/bmp/EncBean</jndi-name>
+            <resource-ref>
+                <ref-name>datasource</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>BmpRMIIIOPBean</ejb-name>
+            <jndi-name>client/tests/entity/bmp/RMI-over-IIOP/EJBHome</jndi-name>
+        </entity>
+
+        <!--
+        ########################################################
+        BMP
+        ########################################################
+        -->
+
+        <entity>
+            <ejb-name>BasicCmpBean</ejb-name>
+            <jndi-name>client/tests/entity/cmp/BasicCmpHome</jndi-name>
+            <query>
+                <query-method>
+                    <method-name>findByLastName</method-name>
+                    <method-params>
+                        <method-param>java.lang.String</method-param>
+                    </method-params>
+                </query-method>
+                <sql>SELECT id FROM BasicCmp WHERE lastName = ?</sql>
+            </query>
+            <query>
+                <query-method>
+                    <method-name>findEmptyCollection</method-name>
+                    <method-params/>
+                </query-method>
+                <sql>SELECT id FROM BasicCmp WHERE 1 = 0</sql>
+            </query>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>AOBasicCmpBean</ejb-name>
+            <jndi-name>client/tests/entity/cmp/allowed_operations/EntityHome</jndi-name>
+            <query>
+                <query-method>
+                    <method-name>findByLastName</method-name>
+                    <method-params>
+                        <method-param>java.lang.String</method-param>
+                    </method-params>
+                </query-method>
+                <sql>SELECT id FROM AOBasicCmp WHERE lastName = ?</sql>
+            </query>
+            <query>
+                <query-method>
+                    <method-name>findEmptyCollection</method-name>
+                    <method-params/>
+                </query-method>
+                <sql>SELECT id FROM AOBasicCmp WHERE 1 = 0</sql>
+            </query>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+            <resource-ref>
+                <ref-name>entity/references/Resource_manager_access</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>EncCmpBean</ejb-name>
+            <jndi-name>client/tests/entity/cmp/EncBean</jndi-name>
+            <resource-ref>
+                <ref-name>jdbc/basic/entityDatabase</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+            <resource-ref>
+                <ref-name>datasource</ref-name>
+                <target-name>DefaultDatasource</target-name>
+            </resource-ref>
+        </entity>
+        <entity>
+            <ejb-name>CmpRMIIIOPBean</ejb-name>
+            <jndi-name>client/tests/entity/cmp/RMI-over-IIOP/EJBHome</jndi-name>
+        </entity>
+    </enterprise-beans>
+
+</openejb-jar>
\ No newline at end of file

Modified: geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java	(original)
+++ geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java	Fri Sep 24 00:08:10 2004
@@ -70,7 +70,7 @@
         try {
             String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd";
             String version = "1.4";
-            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, schemaLocationURL, version));
+            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version));
         } finally {
             cursor2.dispose();
         }
@@ -99,7 +99,7 @@
         try {
             String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";
             String version = "2.1";
-            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, schemaLocationURL, version));
+            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version));
         } finally {
             cursor2.dispose();
         }
@@ -128,7 +128,7 @@
         try {
             String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";
             String version = "2.1";
-            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, schemaLocationURL, version));
+            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version));
         } finally {
             cursor2.dispose();
         }
@@ -235,6 +235,21 @@
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
+    }
+
+    public void testGeronimoNamingNamespaceChange() throws Exception {
+        File srcXml = new File(basedir, "src/test-data/geronimo/ejb-naming-pre.xml");
+        File expectedOutputXml = new File(basedir, "src/test-data/geronimo/ejb-naming-post.xml");
+        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
+        xmlObject = SchemaConversionUtils.convertToGeronimoNamingSchema(xmlObject);
+	//        System.out.println(xmlObject.toString());
+        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+        List problems = new ArrayList();
+        boolean ok = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences: " + problems, ok);
+        xmlObject = SchemaConversionUtils.convertToGeronimoNamingSchema(xmlObject);
+        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences: " + problems, ok2);
     }
 
     private boolean compareXmlObjects(XmlObject xmlObject, XmlObject expectedObject, List problems) {

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	Fri Sep 24 00:08:10 2004
@@ -43,13 +43,12 @@
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
-import org.apache.geronimo.common.xml.XmlBeansUtil;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.deployment.service.GBeanHelper;
-import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.deployment.util.JarUtil;
 import org.apache.geronimo.deployment.util.NestedJarFile;
+import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoFactory;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
@@ -69,8 +68,8 @@
 import org.apache.geronimo.xbeans.j2ee.WebType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 import org.apache.xmlbeans.XmlBeans;
-import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlException;
 
 /**
  * @version $Rev$ $Date$
@@ -155,7 +154,7 @@
         return (SchemaTypeLoader[]) typeLoaders.toArray(new SchemaTypeLoader[typeLoaders.size()]);
     }
 
-    public XmlObject getDeploymentPlan(URL deploymentURL) throws XmlException {
+    public XmlObject getDeploymentPlan(URL deploymentURL) throws DeploymentException {
         try {
             URL moduleBase;
             if (deploymentURL.toString().endsWith("/")) {
@@ -163,9 +162,20 @@
             } else {
                 moduleBase = new URL("jar:" + deploymentURL.toString() + "!/");
             }
-            GerApplicationDocument gerAppDoc = (GerApplicationDocument) XmlBeansUtil.getXmlObject(new URL(moduleBase, "META-INF/geronimo-application.xml"), GerApplicationDocument.type);
-            if (gerAppDoc != null) {
-                return gerAppDoc;
+
+            URL path = new URL(moduleBase, "META-INF/geronimo-application.xml");
+            XmlObject plan = null;
+            try {
+                plan = SchemaConversionUtils.parse(path.openStream());
+            } catch (XmlException e) {
+                throw new DeploymentException(e);
+            } catch (IOException e) {
+                //plan not found, construct default plan
+            }
+            if (plan != null) {
+                plan.changeType(GerApplicationDocument.type);
+                SchemaConversionUtils.validateDD(plan);
+                return plan;
             }
 
             // try to create a default plan (will return null if this is not an ear file)
@@ -174,6 +184,8 @@
                 return defaultPlan;
             }
         } catch (MalformedURLException e) {
+        } catch (XmlException e) {
+            throw new DeploymentException("Invalid geronimo-application.xml", e);
         }
 
         // support a naked modules
@@ -208,7 +220,7 @@
         return null;
     }
 
-    private GerApplicationDocument createDefaultPlan(URL deploymentURL) throws XmlException {
+    private GerApplicationDocument createDefaultPlan(URL deploymentURL) {
         // load the web.xml
         URL applicationXmlUrl = null;
         try {
@@ -321,7 +333,7 @@
                 }
             }
 
-            // each module installs it's files into the output context.. this is differenct for each module type
+            // each module installs it's files into the output context.. this is different for each module type
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                 Module module = (Module) iterator.next();
                 getBuilder(module).installModule(earFile, earContext, module);
@@ -378,16 +390,12 @@
     private ApplicationType addModules(final JarFile earFile, XmlObject plan, URI configId, Set moduleLocations, Set modules) throws IOException, DeploymentException {
         if (plan instanceof GerApplicationDocument) {
             ApplicationType application;
-            try {
-                JarEntry appXMLEntry = earFile.getJarEntry("META-INF/application.xml");
-                if (appXMLEntry == null) {
-                    throw new DeploymentException("Did not find META-INF/application.xml in earFile");
-                }
-                InputStream ddInputStream = earFile.getInputStream(appXMLEntry);
-                application = getApplicationDocument(ddInputStream).getApplication();
-            } catch (XmlException e) {
-                throw new DeploymentException("Unable to parse application.xml", e);
+            JarEntry appXMLEntry = earFile.getJarEntry("META-INF/application.xml");
+            if (appXMLEntry == null) {
+                throw new DeploymentException("Did not find META-INF/application.xml in earFile");
             }
+            InputStream ddInputStream = earFile.getInputStream(appXMLEntry);
+            application = getApplicationDocument(ddInputStream).getApplication();
 
             // build map from module path to alt vendor dd
             Map altVendorDDs = new HashMap();
@@ -457,11 +465,7 @@
                     XmlObject vendorDD = null;
                     URL altVendorDD = (URL) altVendorDDs.get(modulePath);
                     if (altVendorDD != null) {
-                        try {
-                            vendorDD = builder.parseVendorDD(altVendorDD);
-                        } catch (XmlException e) {
-                            throw new DeploymentException("Unable to parse " + altVendorDD, e);
-                        }
+                        vendorDD = builder.parseVendorDD(altVendorDD);
                         if (vendorDD == null) {
                             throw new DeploymentException("Invalid alt vendor dd: modulePath=" + modulePath + ", url=" + altVendorDD);
                         }
@@ -469,7 +473,7 @@
 
                     Module module = builder.createModule(modulePath, new NestedJarFile(earFile, modulePath), vendorDD, modulePath, altSpecDD);
                     if (module instanceof WebModule) {
-                        ((WebModule)module).setContextRoot(webContextRoot);
+                        ((WebModule) module).setContextRoot(webContextRoot);
                     }
 
                     modules.add(module);
@@ -485,7 +489,7 @@
         } else if (connectorConfigBuilder != null && connectorConfigBuilder.canHandlePlan(plan)) {
             modules.add(connectorConfigBuilder.createModule(configId.toString(), earFile, plan));
             return null;
-        } else if (appClientConfigBuilder!= null && appClientConfigBuilder.canHandlePlan(plan)) {
+        } else if (appClientConfigBuilder != null && appClientConfigBuilder.canHandlePlan(plan)) {
             modules.add(appClientConfigBuilder.createModule(configId.toString(), earFile, plan));
             return null;
         }
@@ -517,15 +521,14 @@
         throw new IllegalArgumentException("Unknown module type: " + module.getClass().getName());
     }
 
-    private ApplicationDocument getApplicationDocument(InputStream ddInputStream) throws XmlException, DeploymentException {
+    private ApplicationDocument getApplicationDocument(InputStream ddInputStream) throws DeploymentException {
         XmlObject dd;
         try {
             dd = SchemaConversionUtils.parse(ddInputStream);
-        } catch (IOException e) {
+            return SchemaConversionUtils.convertToApplicationSchema(dd);
+        } catch (Exception e) {
             throw new DeploymentException(e);
         }
-        ApplicationDocument applicationDocument = SchemaConversionUtils.convertToApplicationSchema(dd);
-        return applicationDocument;
     }
 
     private URI getParentId(XmlObject plan) throws DeploymentException {

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java	Fri Sep 24 00:08:10 2004
@@ -31,9 +31,9 @@
 public interface ModuleBuilder {
     XmlObject parseSpecDD(URL path) throws DeploymentException;
 
-    XmlObject parseVendorDD(URL vendorURL) throws XmlException;
+    XmlObject parseVendorDD(URL vendorURL) throws DeploymentException;
 
-    XmlObject getDeploymentPlan(URL module) throws XmlException;
+    XmlObject getDeploymentPlan(URL module) throws DeploymentException;
 
     boolean canHandlePlan(XmlObject plan);
 

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java	Fri Sep 24 00:08:10 2004
@@ -90,13 +90,13 @@
         }
     }
 
-    public XmlObject parseVendorDD(URL vendorURL) throws XmlException {
+    public XmlObject parseVendorDD(URL vendorURL) throws DeploymentException {
         InputStream in = null;
         try {
             in = vendorURL.openStream();
             return XmlObject.Factory.newInstance();
         } catch (IOException e) {
-            throw new XmlException(e);
+            throw new DeploymentException(e);
         } finally {
             if (in != null) {
                 try {

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java	Fri Sep 24 00:08:10 2004
@@ -90,13 +90,13 @@
         }
     }
 
-    public XmlObject parseVendorDD(URL vendorURL) throws XmlException {
+    public XmlObject parseVendorDD(URL vendorURL) throws DeploymentException {
         InputStream in = null;
         try {
             in = vendorURL.openStream();
             return XmlObject.Factory.newInstance();
         } catch (IOException e) {
-            throw new XmlException(e);
+            throw new DeploymentException(e);
         } finally {
             if (in != null) {
                 try {

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java	Fri Sep 24 00:08:10 2004
@@ -91,13 +91,13 @@
         }
     }
 
-    public XmlObject parseVendorDD(URL vendorURL) throws XmlException {
+    public XmlObject parseVendorDD(URL vendorURL) throws DeploymentException {
         InputStream in = null;
         try {
             in = vendorURL.openStream();
             return XmlObject.Factory.newInstance();
         } catch (IOException e) {
-            throw new XmlException(e);
+            throw new DeploymentException(e);
         } finally {
             if (in != null) {
                 try {

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	Fri Sep 24 00:08:10 2004
@@ -65,10 +65,10 @@
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyDefaultPrincipalType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyDependencyType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyGbeanType;
-import org.apache.geronimo.xbeans.geronimo.jetty.JettyLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyPrincipalType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyRealmType;
-import org.apache.geronimo.xbeans.geronimo.jetty.JettyRemoteRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyRoleMappingsType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyRoleType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettySecurityType;
@@ -117,11 +117,19 @@
         return webAppDoc.getWebApp();
     }
 
-    public XmlObject parseVendorDD(URL vendorURL) throws XmlException {
-        return XmlBeansUtil.getXmlObject(vendorURL, JettyWebAppDocument.type);
+    public XmlObject parseVendorDD(URL path) throws DeploymentException {
+        try {
+            XmlObject dd = SchemaConversionUtils.parse(path.openStream());
+            dd = SchemaConversionUtils.convertToGeronimoNamingSchema(dd);
+            dd = dd.changeType(JettyWebAppDocument.type);
+            SchemaConversionUtils.validateDD(dd);
+            return dd;
+        } catch (Exception e) {
+            throw new DeploymentException(e);
+        }
     }
 
-    public XmlObject getDeploymentPlan(URL module) throws XmlException {
+    public XmlObject getDeploymentPlan(URL module) throws DeploymentException {
         try {
             URL moduleBase;
             if (module.toString().endsWith("/")) {
@@ -164,21 +172,21 @@
             if (id.endsWith(".war")) {
                 id = id.substring(0, id.length() - 4);
             }
-            if ( id.endsWith("/") ) {
+            if (id.endsWith("/")) {
                 id = id.substring(0, id.length() - 1);
             }
             id = id.substring(id.lastIndexOf('/') + 1);
         }
         return newJettyWebAppDocument(webApp, id);
     }
-    
+
     private JettyWebAppDocument newJettyWebAppDocument(WebAppType webApp, String id) {
         JettyWebAppDocument jettyWebAppDocument = JettyWebAppDocument.Factory.newInstance();
         JettyWebAppType jettyWebApp = jettyWebAppDocument.addNewWebApp();
 
         // set the parentId, configId and context root
         jettyWebApp.setParentId(PARENT_ID);
-        if ( null != webApp.getId() ) {
+        if (null != webApp.getId()) {
             id = webApp.getId();
         }
         jettyWebApp.setConfigId(id);
@@ -392,12 +400,12 @@
                 cl);
     }
 
-    private static Map mapRefs(JettyRemoteRefType[] refs) {
+    private static Map mapRefs(GerRemoteRefType[] refs) {
         Map refMap = new HashMap();
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
-                JettyRemoteRefType ref = refs[i];
-                refMap.put(ref.getRefName(), new JettyRefAdapter(ref));
+                GerRemoteRefType ref = refs[i];
+                refMap.put(ref.getRefName(), ref);
             }
         }
         return refMap;
@@ -459,10 +467,10 @@
         return principal;
     }
 
-    private void setResourceEnvironment(GBeanMBean bean, ResourceRefType[] resourceRefArray, JettyLocalRefType[] jettyResourceRefArray) throws AttributeNotFoundException, ReflectionException {
+    private void setResourceEnvironment(GBeanMBean bean, ResourceRefType[] resourceRefArray, GerLocalRefType[] jettyResourceRefArray) throws AttributeNotFoundException, ReflectionException {
         Map openejbNames = new HashMap();
         for (int i = 0; i < jettyResourceRefArray.length; i++) {
-            JettyLocalRefType jettyLocalRefType = jettyResourceRefArray[i];
+            GerLocalRefType jettyLocalRefType = jettyResourceRefArray[i];
             openejbNames.put(jettyLocalRefType.getRefName(), jettyLocalRefType.getTargetName());
         }
         Set unshareableResources = new HashSet();

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java	(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java	Fri Sep 24 00:08:10 2004
@@ -24,10 +24,9 @@
 
 import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
 import org.apache.geronimo.naming.deployment.ENCHelper;
-import org.apache.geronimo.naming.deployment.RefAdapter;
-import org.apache.geronimo.xbeans.geronimo.jetty.JettyLocalRefType;
-import org.apache.geronimo.xbeans.geronimo.jetty.JettyRemoteRefType;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 
 /**
@@ -43,97 +42,72 @@
         super(ddBean, webApp);
 
         ENCHelper.XmlEnvRefs envRefs = new ENCHelper.XmlEnvRefs() {
-            public RefAdapter[] getEjbRefs() {
-                return wrapArray(getWebApp().getEjbRefArray());
+            public GerRemoteRefType[] getEjbRefs() {
+                return getWebApp().getEjbRefArray();
             }
 
-            public RefAdapter addNewEjbRef() {
-                return new JettyRefAdapter(getWebApp().addNewEjbRef());
+            public GerRemoteRefType addNewEjbRef() {
+                return getWebApp().addNewEjbRef();
             }
 
-            public void setEjbRef(int i, RefAdapter refAdapter) {
-                getWebApp().setEjbRefArray(i, (JettyRemoteRefType) refAdapter.getXmlObject());
-                refAdapter.setXmlObject(getWebApp().getEjbRefArray(i));
+            public GerRemoteRefType setEjbRef(int i, GerRemoteRefType remoteRef) {
+                getWebApp().setEjbRefArray(i, remoteRef);
+                return getWebApp().getEjbRefArray(i);
             }
 
             public void removeEjbRef(int i) {
                 getWebApp().removeEjbRef(i);
             }
 
-            public RefAdapter[] getEjbLocalRefs() {
-                return wrapArray(getWebApp().getEjbLocalRefArray());
+            public GerLocalRefType[] getEjbLocalRefs() {
+                return getWebApp().getEjbLocalRefArray();
             }
 
-            public RefAdapter addNewEjbLocalRef() {
-                return new JettyRefAdapter(getWebApp().addNewEjbLocalRef());
+            public GerLocalRefType addNewEjbLocalRef() {
+                return getWebApp().addNewEjbLocalRef();
             }
 
-            public void setEjbLocalRef(int i, RefAdapter refAdapter) {
-                getWebApp().setEjbLocalRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
-                refAdapter.setXmlObject(getWebApp().getEjbLocalRefArray(i));
+            public GerLocalRefType setEjbLocalRef(int i, GerLocalRefType localRef) {
+                getWebApp().setEjbLocalRefArray(i, localRef);
+                return getWebApp().getEjbLocalRefArray(i);
             }
 
             public void removeEjbLocalRef(int i) {
                 getWebApp().removeEjbLocalRef(i);
             }
 
-            public RefAdapter[] getMessageDestinationRefs() {
-                return wrapArray(getWebApp().getMessageDestinationRefArray());
+            public GerLocalRefType[] getResourceEnvRefs() {
+                return getWebApp().getResourceEnvRefArray();
             }
 
-            public RefAdapter addNewMessageDestinationRef() {
-                return new JettyRefAdapter(getWebApp().addNewMessageDestinationRef());
+            public GerLocalRefType addNewResourceEnvRef() {
+                return getWebApp().addNewResourceEnvRef();
             }
 
-            public void setMessageDestinationRef(int i, RefAdapter refAdapter) {
-                getWebApp().setMessageDestinationRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
-                refAdapter.setXmlObject(getWebApp().getMessageDestinationRefArray(i));
-            }
-
-            public void removeMessageDestinationRef(int i) {
-                getWebApp().removeMessageDestinationRef(i);
-            }
-
-            public RefAdapter[] getResourceEnvRefs() {
-                return wrapArray(getWebApp().getResourceEnvRefArray());
-            }
-
-            public RefAdapter addNewResourceEnvRef() {
-                return new JettyRefAdapter(getWebApp().addNewResourceEnvRef());
-            }
-
-            public void setResourceEnvRef(int i, RefAdapter refAdapter) {
-                getWebApp().setResourceEnvRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
-                refAdapter.setXmlObject(getWebApp().getResourceEnvRefArray(i));
+            public GerLocalRefType setResourceEnvRef(int i, GerLocalRefType localRef) {
+                getWebApp().setResourceEnvRefArray(i, localRef);
+                return getWebApp().getResourceEnvRefArray(i);
             }
 
             public void removeResourceEnvRef(int i) {
                 getWebApp().removeResourceEnvRef(i);
             }
 
-            public RefAdapter[] getResourceRefs() {
-                return wrapArray(getWebApp().getResourceRefArray());
+            public GerLocalRefType[] getResourceRefs() {
+                return getWebApp().getResourceRefArray();
             }
 
-            public RefAdapter addNewResourceRef() {
-                return new JettyRefAdapter(getWebApp().addNewResourceRef());
+            public GerLocalRefType addNewResourceRef() {
+                return getWebApp().addNewResourceRef();
             }
 
-            public void setResourceRef(int i, RefAdapter refAdapter) {
-                getWebApp().setResourceRefArray(i, (JettyLocalRefType) refAdapter.getXmlObject());
-                refAdapter.setXmlObject(getWebApp().getResourceRefArray(i));
+            public GerLocalRefType setResourceRef(int i, GerLocalRefType localRef) {
+                getWebApp().setResourceRefArray(i, localRef);
+                return getWebApp().getResourceRefArray(i);
             }
 
             public void removeResourceRef(int i) {
                 getWebApp().removeResourceRef(i);
-            }
-
-            private RefAdapter[] wrapArray(JettyRemoteRefType[] refs) {
-                RefAdapter[] wrapped = new RefAdapter[refs.length];
-                for (int i = 0; i < refs.length; i++) {
-                    wrapped[i] = new JettyRefAdapter(refs[i]);
-                }
-                return wrapped;
             }
 
         };

Modified: geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd
==============================================================================
--- geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd	(original)
+++ geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd	Fri Sep 24 00:08:10 2004
@@ -19,17 +19,18 @@
 <xs:schema
     xmlns:jetty="http://geronimo.apache.org/xml/ns/web/jetty"
     xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
     targetNamespace="http://geronimo.apache.org/xml/ns/web/jetty"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">
 
-<!--
-    <xs:import namespace="http://geronimo.apache.org/xml/ns/j2ee" schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
--->
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming" schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
 
+    <!--
     <xs:include schemaLocation="../../../naming/src/schema/geronimo-naming.xsd"/>
+    -->
     <xs:include schemaLocation="../../../deployment/src/schema/geronimo-common.xsd"/>
     <xs:include schemaLocation="../../../security/src/schema/geronimo-security.xsd"/>
 
@@ -42,16 +43,16 @@
             <xs:element name="context-root" type="xs:string" minOccurs="0" maxOccurs="1"/>
             <xs:element name="context-priority-classloader" type="xs:boolean"/>
 
-            <!--xs:group ref="jetty:jndiEnvironmentRefsGroup"/-->
-            <xs:element name="ejb-ref"
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <!--xs:element name="ejb-ref"
                 type="jetty:remote-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="ejb-local-ref"
                 type="jetty:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
+                minOccurs="0" maxOccurs="unbounded"/-->
             <!-- leave web services out until I know what they do -->
             <!--xsd:group ref="service-refGroup"/-->
-            <xs:element name="resource-ref"
+            <!--xs:element name="resource-ref"
                 type="jetty:local-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="resource-env-ref"
@@ -59,7 +60,7 @@
                 minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="message-destination-ref"
                 type="jetty:remote-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
+                minOccurs="0" maxOccurs="unbounded"/-->
             <xs:element name="security" type="jetty:securityType" minOccurs="0"/>
 
             <xs:element name="gbean" type="jetty:gbeanType" minOccurs="0" maxOccurs="unbounded"/>

Modified: geronimo/trunk/modules/naming/maven.xml
==============================================================================
--- geronimo/trunk/modules/naming/maven.xml	(original)
+++ geronimo/trunk/modules/naming/maven.xml	Fri Sep 24 00:08:10 2004
@@ -22,13 +22,13 @@
 <project default="default"
     xmlns:xmlbeans="geronimo:xmlbeans">
 
-    <!--preGoal name="java:compile">
+    <preGoal name="java:compile">
         <xmlbeans:schema2java
             sourcedir="${basedir}/src"
             sourceschema="schema/geronimo-naming.xsd"
             xmlconfigs="${basedir}/src/schema/xmlconfig.xml"
             targetdir="${basedir}/target/xmlbeans"
-            cataloglocation="${basedir}/../../specs/schema/src/catalog/resolver-catalog.xml"/>
-    </preGoal-->
+            cataloglocation="${basedir}/../j2ee-schema/src/catalog/resolver-catalog.xml"/>
+    </preGoal>
 
 </project>

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java	Fri Sep 24 00:08:10 2004
@@ -16,23 +16,24 @@
  */
 package org.apache.geronimo.naming;
 
-import javax.naming.Reference;
 import javax.management.MalformedObjectNameException;
+import javax.naming.Reference;
 
-import org.apache.geronimo.naming.deployment.RefAdapter;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 
 /**
  * @version $Revision$ $Date$
  */
 public interface ReferenceFactory {
-    Reference buildConnectionFactoryReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+    Reference buildConnectionFactoryReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException;
 
-    Reference buildAdminObjectReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+    Reference buildAdminObjectReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException;
 
     //TODO warning: this only works if there is only one kernel!
     Reference buildMessageDestinationReference(String linkName, Class iface) throws MalformedObjectNameException;
 
-    Reference buildEjbReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+    Reference buildEjbReference(GerRemoteRefType remoteRef, Class iface) throws MalformedObjectNameException;
 
-    Reference buildEjbLocalReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+    Reference buildEjbLocalReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException;
 }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java	Fri Sep 24 00:08:10 2004
@@ -25,6 +25,8 @@
 import javax.transaction.UserTransaction;
 
 import org.apache.geronimo.xbeans.j2ee.*;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
@@ -67,12 +69,12 @@
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("could not load class " + type, e);
             }
-            RefAdapter refAdapter = (RefAdapter) refAdapterMap.get(name);
-            if (refAdapter == null) {
+            GerLocalRefType localRef = (GerLocalRefType) refAdapterMap.get(name);
+            if (localRef == null) {
                 throw  new DeploymentException("No geronimo configuration for resource ref named: " + name);
             }
             try {
-                builder.addResourceRef(name, iface, refAdapter);
+                builder.addResourceRef(name, iface, localRef);
             } catch (NamingException e) {
                 throw new DeploymentException("Invalid resource-ref definition for name: " + name, e);
             }
@@ -91,12 +93,12 @@
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("could not load class " + type, e);
             }
-            RefAdapter refAdapter = (RefAdapter) refAdapterMap.get(name);
-            if (refAdapter == null) {
+            GerLocalRefType localRef = (GerLocalRefType) refAdapterMap.get(name);
+            if (localRef == null) {
                 throw  new DeploymentException("No geronimo configuration for resource env ref named: " + name);
             }
             try {
-                builder.addResourceEnvRef(name, iface, refAdapter);
+                builder.addResourceEnvRef(name, iface, localRef);
             } catch (NamingException e) {
                 throw new DeploymentException("Invalid resource-env-ref definition for name: " + name, e);
             }
@@ -147,12 +149,12 @@
                     throw new DeploymentException("Unable to to bind ejb-ref: ejb-ref-name=" + ejbRefName);
                 }
             } else {
-                RefAdapter refAdapter = (RefAdapter) ejbRefMap.get(ejbRefName);
-                if (refAdapter == null) {
+                GerRemoteRefType remoteRef = (GerRemoteRefType) ejbRefMap.get(ejbRefName);
+                if (remoteRef == null) {
                     throw  new DeploymentException("No geronimo configuration for resource ref named: " + ejbRefName);
                 }
                 try {
-                    builder.bind(ejbRefName, earContext.createEJBRemoteReference(refAdapter.getTargetName(), isSession, home, remote));
+                    builder.bind(ejbRefName, earContext.createEJBRemoteReference(remoteRef.getTargetName(), isSession, home, remote));
                 } catch (NamingException e) {
                     throw new DeploymentException("Invalid env-entry definition for name: " + ejbRefName, e);
                 }
@@ -183,12 +185,12 @@
                     throw new DeploymentException("Unable to to bind ejb-local-ref: ejb-ref-name=" + ejbRefName);
                 }
             } else {
-                RefAdapter refAdapter = (RefAdapter) ejbLocalRefMap.get(ejbRefName);
-                if (refAdapter == null) {
+                GerLocalRefType localRef = (GerLocalRefType) ejbLocalRefMap.get(ejbRefName);
+                if (localRef == null) {
                     throw  new DeploymentException("No geronimo configuration for resource ref named: " + ejbRefName);
                 }
                 try {
-                    builder.bind(ejbRefName, earContext.createEJBLocalReference(refAdapter.getTargetName(), isSession, localHome, local));
+                    builder.bind(ejbRefName, earContext.createEJBLocalReference(localRef.getTargetName(), isSession, localHome, local));
                 } catch (NamingException e) {
                     throw new DeploymentException("Invalid env-entry definition for name: " + ejbRefName, e);
                 }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCHelper.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCHelper.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCHelper.java	Fri Sep 24 00:08:10 2004
@@ -19,12 +19,13 @@
 
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.enterprise.deploy.model.DDBean;
 import javax.enterprise.deploy.spi.DConfigBean;
 import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException;
 import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
 
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 import org.apache.xmlbeans.XmlBeans;
 
@@ -42,7 +43,6 @@
     public static final String[][] ENC_XPATHS = {
         {"ejb-ref"},
         {"ejb-local-ref"},
-        {"message-destination-ref"},
         {"resource-env-ref"},
         {"resource-ref"},
     };
@@ -50,14 +50,10 @@
     public static final String[][] NAME_XPATHS = {
         {"ejb-ref-name"},
         {"ejb-ref-name"},
-        {"message-destination-ref-name"},
         {"resource-env-ref-name"},
         {"res-ref-name"}
     };
 
-    private final DDBean ddBean;
-
-    private final XmlEnvRefs envRefs;
 
     private final String[] xpaths;
     private final String[] namePaths;
@@ -65,13 +61,10 @@
     private LocalRefDConfigBean[] ejbRefs;
 
     private LocalRefDConfigBean[] ejbLocalRefs;
-    private LocalRefDConfigBean[] messageDestinationRefs;
     private LocalRefDConfigBean[] resourceEnvRefs;
     private LocalRefDConfigBean[] resourceRefs;
 
     public ENCHelper(DDBean ddBean, XmlEnvRefs envRefs, String[] xpaths, String[] namePaths) {
-        this.ddBean = ddBean;
-        this.envRefs = envRefs;
         this.xpaths = xpaths;
         this.namePaths = namePaths;
         DDBean[] ddEjbRefs = ddBean.getChildBean(xpaths[0]);
@@ -79,22 +72,22 @@
             ddEjbRefs = new DDBean[0];
         }
         ejbRefs = new RemoteRefDConfigBean[ddEjbRefs.length];
-        RefAdapter[] xmlEjbRefs = envRefs.getEjbRefs();
+        GerRemoteRefType[] xmlEjbRefs = envRefs.getEjbRefs();
         Map ejbRefMap = new HashMap();
         for (int i = 0; i < xmlEjbRefs.length; i++) {
-            RefAdapter refAdapter = xmlEjbRefs[i];
+            GerRemoteRefType refAdapter = xmlEjbRefs[i];
             ejbRefMap.put(refAdapter.getRefName(), refAdapter);
             envRefs.removeEjbRef(0);
         }
         for (int i = 0; i < ddEjbRefs.length; i++) {
             DDBean ddRef = ddEjbRefs[i];
             String name = ddRef.getText(namePaths[0])[0];
-            RefAdapter refAdapter;
+            GerRemoteRefType refAdapter;
             if (ejbRefMap.get(name) == null) {
                 refAdapter = envRefs.addNewEjbRef();
                 refAdapter.setRefName(name);
             } else {
-                refAdapter = (RefAdapter) ejbRefMap.get(name);
+                refAdapter = (GerRemoteRefType) ejbRefMap.get(name);
                 envRefs.setEjbRef(i, refAdapter);
             }
             ejbRefs[i] = new RemoteRefDConfigBean(ddRef, refAdapter, namePaths[0]);
@@ -105,104 +98,78 @@
             ddEjbLocalRefs = new DDBean[0];
         }
         ejbLocalRefs = new LocalRefDConfigBean[ddEjbLocalRefs.length];
-        RefAdapter[] xmlEjbLocalRefs = envRefs.getEjbLocalRefs();
+        GerLocalRefType[] xmlEjbLocalRefs = envRefs.getEjbLocalRefs();
         Map ejbLocalRefMap = new HashMap();
         for (int i = 0; i < xmlEjbLocalRefs.length; i++) {
-            RefAdapter refAdapter = xmlEjbLocalRefs[i];
+            GerLocalRefType refAdapter = xmlEjbLocalRefs[i];
             ejbLocalRefMap.put(refAdapter.getRefName(), refAdapter);
             envRefs.removeEjbLocalRef(0);
         }
         for (int i = 0; i < ddEjbLocalRefs.length; i++) {
             DDBean ddRef = ddEjbLocalRefs[i];
             String name = ddRef.getText(namePaths[1])[0];
-            RefAdapter refAdapter;
+            GerLocalRefType refAdapter;
             if (ejbLocalRefMap.get(name) == null) {
                 refAdapter = envRefs.addNewEjbLocalRef();
                 refAdapter.setRefName(name);
             } else {
-                refAdapter = (RefAdapter) ejbLocalRefMap.get(name);
+                refAdapter = (GerLocalRefType) ejbLocalRefMap.get(name);
                 envRefs.setEjbLocalRef(i, refAdapter);
             }
             ejbLocalRefs[i] = new LocalRefDConfigBean(ddRef, refAdapter, namePaths[1]);
         }
 
-        DDBean[] ddMessageDestinationRefs = ddBean.getChildBean(xpaths[2]);
-        if (ddMessageDestinationRefs == null) {
-            ddMessageDestinationRefs = new DDBean[0];
-        }
-        messageDestinationRefs = new LocalRefDConfigBean[ddMessageDestinationRefs.length];
-        RefAdapter[] xmlMessageDestinationRefs = envRefs.getMessageDestinationRefs();
-        Map messageDestinationRefMap = new HashMap();
-        for (int i = 0; i < xmlMessageDestinationRefs.length; i++) {
-            RefAdapter refAdapter = xmlMessageDestinationRefs[i];
-            messageDestinationRefMap.put(refAdapter.getRefName(), refAdapter);
-            envRefs.removeMessageDestinationRef(0);
-        }
-        for (int i = 0; i < ddMessageDestinationRefs.length; i++) {
-            DDBean ddRef = ddMessageDestinationRefs[i];
-            String name = ddRef.getText(namePaths[2])[0];
-            RefAdapter refAdapter;
-            if (messageDestinationRefMap.get(name) == null) {
-                refAdapter = envRefs.addNewMessageDestinationRef();
-                refAdapter.setRefName(name);
-            } else {
-                refAdapter = (RefAdapter) messageDestinationRefMap.get(name);
-                envRefs.setMessageDestinationRef(i, refAdapter);
-            }
-            //??? local or remote
-            messageDestinationRefs[i] = new RemoteRefDConfigBean(ddRef, refAdapter, namePaths[2]);
-        }
 
-        DDBean[] ddResourceEnvRefs = ddBean.getChildBean(xpaths[3]);
+        DDBean[] ddResourceEnvRefs = ddBean.getChildBean(xpaths[2]);
         if (ddResourceEnvRefs == null) {
             ddResourceEnvRefs = new DDBean[0];
         }
         resourceEnvRefs = new LocalRefDConfigBean[ddResourceEnvRefs.length];
-        RefAdapter[] xmlResourceEnvRefs = envRefs.getResourceEnvRefs();
+        GerLocalRefType[] xmlResourceEnvRefs = envRefs.getResourceEnvRefs();
         Map resourceEnvRefMap = new HashMap();
         for (int i = 0; i < xmlResourceEnvRefs.length; i++) {
-            RefAdapter refAdapter = xmlResourceEnvRefs[i];
+            GerLocalRefType refAdapter = xmlResourceEnvRefs[i];
             resourceEnvRefMap.put(refAdapter.getRefName(), refAdapter);
             envRefs.removeResourceEnvRef(0);
         }
         for (int i = 0; i < ddResourceEnvRefs.length; i++) {
             DDBean ddRef = ddResourceEnvRefs[i];
-            String name = ddRef.getText(namePaths[3])[0];
-            RefAdapter refAdapter;
+            String name = ddRef.getText(namePaths[2])[0];
+            GerLocalRefType refAdapter;
             if (resourceEnvRefMap.get(name) == null) {
                 refAdapter = envRefs.addNewResourceEnvRef();
                 refAdapter.setRefName(name);
             } else {
-                refAdapter = (RefAdapter) resourceEnvRefMap.get(name);
+                refAdapter = (GerLocalRefType) resourceEnvRefMap.get(name);
                 envRefs.setResourceEnvRef(i, refAdapter);
             }
-            resourceEnvRefs[i] = new LocalRefDConfigBean(ddRef, refAdapter, namePaths[3]);
+            resourceEnvRefs[i] = new LocalRefDConfigBean(ddRef, refAdapter, namePaths[2]);
         }
 
-        DDBean[] ddResourceRefs = ddBean.getChildBean(xpaths[4]);
+        DDBean[] ddResourceRefs = ddBean.getChildBean(xpaths[3]);
         if (ddResourceRefs == null) {
             ddResourceRefs = new DDBean[0];
         }
         resourceRefs = new LocalRefDConfigBean[ddResourceRefs.length];
-        RefAdapter[] xmlResourceRefs = envRefs.getResourceRefs();
+        GerLocalRefType[] xmlResourceRefs = envRefs.getResourceRefs();
         Map resourceRefMap = new HashMap();
         for (int i = 0; i < xmlResourceRefs.length; i++) {
-            RefAdapter refAdapter = xmlResourceRefs[i];
+            GerLocalRefType refAdapter = xmlResourceRefs[i];
             resourceRefMap.put(refAdapter.getRefName(), refAdapter);
             envRefs.removeResourceRef(0);
         }
         for (int i = 0; i < ddResourceRefs.length; i++) {
             DDBean ddRef = ddResourceRefs[i];
-            String name = ddRef.getText(namePaths[4])[0];
-            RefAdapter refAdapter;
+            String name = ddRef.getText(namePaths[3])[0];
+            GerLocalRefType refAdapter;
             if (resourceRefMap.get(name) == null) {
                 refAdapter = envRefs.addNewResourceRef();
                 refAdapter.setRefName(name);
             } else {
-                refAdapter = (RefAdapter) resourceRefMap.get(name);
+                refAdapter = (GerLocalRefType) resourceRefMap.get(name);
                 envRefs.setResourceRef(i, refAdapter);
             }
-            resourceRefs[i] = new LocalRefDConfigBean(ddRef, refAdapter, namePaths[4]);
+            resourceRefs[i] = new LocalRefDConfigBean(ddRef, refAdapter, namePaths[3]);
         }
 
     }
@@ -229,15 +196,6 @@
             throw new ConfigurationException("no such ejb-ref-name" + name);
         } else if (xpath.equals(xpaths[2])) {
             String name = ddBean.getText(namePaths[2])[0];
-            for (int i = 0; i < messageDestinationRefs.length; i++) {
-                LocalRefDConfigBean messageDestinationRef = messageDestinationRefs[i];
-                if (messageDestinationRef.getRefName().equals(name)) {
-                    return messageDestinationRef;
-                }
-            }
-            throw new ConfigurationException("no such ejb-ref-name" + name);
-        } else if (xpath.equals(xpaths[3])) {
-            String name = ddBean.getText(namePaths[3])[0];
             for (int i = 0; i < resourceEnvRefs.length; i++) {
                 LocalRefDConfigBean resourceEnvRef = resourceEnvRefs[i];
                 if (resourceEnvRef.getRefName().equals(name)) {
@@ -245,8 +203,8 @@
                 }
             }
             throw new ConfigurationException("no such ejb-ref-name" + name);
-        } else if (xpath.equals(xpaths[4])) {
-            String name = ddBean.getText(namePaths[4])[0];
+        } else if (xpath.equals(xpaths[3])) {
+            String name = ddBean.getText(namePaths[3])[0];
             for (int i = 0; i < resourceRefs.length; i++) {
                 LocalRefDConfigBean resourceRef = resourceRefs[i];
                 if (resourceRef.getRefName().equals(name)) {
@@ -260,9 +218,9 @@
     }
 
       public void removeDConfigBean(DConfigBean dcBean) throws BeanNotFoundException {
-          DDBean ddBean = dcBean.getDDBean();
-          String xpath = ddBean.getXpath();
-          String name = ddBean.getText();
+//          DDBean ddBean = dcBean.getDDBean();
+//          String xpath = ddBean.getXpath();
+//          String name = ddBean.getText();
     /*
           if (xpath.endsWith("ejb-ref/ejb-ref-name")) {
               if (ejbRefs.remove(name) == null) {
@@ -288,43 +246,35 @@
 
 
     public interface XmlEnvRefs {
-        RefAdapter[] getEjbRefs();
+        GerRemoteRefType[] getEjbRefs();
 
-        RefAdapter addNewEjbRef();
+        GerRemoteRefType addNewEjbRef();
 
-        void setEjbRef(int i, RefAdapter refAdapter);
+        GerRemoteRefType setEjbRef(int i, GerRemoteRefType refAdapter);
 
         void removeEjbRef(int i);
 
-        RefAdapter[] getEjbLocalRefs();
+        GerLocalRefType[] getEjbLocalRefs();
 
-        RefAdapter addNewEjbLocalRef();
+        GerLocalRefType addNewEjbLocalRef();
 
-        void setEjbLocalRef(int i, RefAdapter refAdapter);
+        GerLocalRefType setEjbLocalRef(int i, GerLocalRefType refAdapter);
 
         void removeEjbLocalRef(int i);
 
-        RefAdapter[] getMessageDestinationRefs();
-
-        RefAdapter addNewMessageDestinationRef();
-
-        void setMessageDestinationRef(int i, RefAdapter refAdapter);
-
-        void removeMessageDestinationRef(int i);
-
-        RefAdapter[] getResourceEnvRefs();
+        GerLocalRefType[] getResourceEnvRefs();
 
-        RefAdapter addNewResourceEnvRef();
+        GerLocalRefType addNewResourceEnvRef();
 
-        void setResourceEnvRef(int i, RefAdapter refAdapter);
+        GerLocalRefType setResourceEnvRef(int i, GerLocalRefType refAdapter);
 
         void removeResourceEnvRef(int i);
 
-        RefAdapter[] getResourceRefs();
+        GerLocalRefType[] getResourceRefs();
 
-        RefAdapter addNewResourceRef();
+        GerLocalRefType addNewResourceRef();
 
-        void setResourceRef(int i, RefAdapter refAdapter);
+        GerLocalRefType setResourceRef(int i, GerLocalRefType refAdapter);
 
         void removeResourceRef(int i);
 

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/LocalRefDConfigBean.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/LocalRefDConfigBean.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/LocalRefDConfigBean.java	Fri Sep 24 00:08:10 2004
@@ -20,6 +20,7 @@
 import javax.enterprise.deploy.model.DDBean;
 
 import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 
 /**
@@ -29,10 +30,10 @@
  */
 public class LocalRefDConfigBean extends DConfigBeanSupport {
 
-    protected final RefAdapter ref;
+    protected final GerRemoteRefType ref;
 
-    public LocalRefDConfigBean(DDBean ddBean, RefAdapter ref, String namePath) {
-        super(ddBean, ref.getXmlObject());
+    public LocalRefDConfigBean(DDBean ddBean, GerRemoteRefType ref, String namePath) {
+        super(ddBean, ref);
         this.ref = ref;
 
         assert ddBean.getChildBean(namePath)[0].getText().equals(getRefName());

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/RemoteRefDConfigBean.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/RemoteRefDConfigBean.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/RemoteRefDConfigBean.java	Fri Sep 24 00:08:10 2004
@@ -19,6 +19,8 @@
 
 import javax.enterprise.deploy.model.DDBean;
 
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
+
 /**
  *
  *
@@ -27,15 +29,15 @@
  * */
 public class RemoteRefDConfigBean extends LocalRefDConfigBean {
 
-    public RemoteRefDConfigBean(DDBean ddBean, RefAdapter ref, String namePath) {
+    public RemoteRefDConfigBean(DDBean ddBean, GerRemoteRefType ref, String namePath) {
         super (ddBean, ref, namePath);
     }
 
     public String getServerName() {
-        return ref.getServerName();
+        return ref.getServer();
     }
 
     public void setServerName(String serverName) {
-        ref.setServerName(serverName);
+        ref.setServer(serverName);
     }
 }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java	Fri Sep 24 00:08:10 2004
@@ -23,8 +23,9 @@
 import javax.naming.NamingException;
 import javax.transaction.UserTransaction;
 
-import org.apache.geronimo.naming.deployment.RefAdapter;
 import org.apache.geronimo.naming.ReferenceFactory;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 
 /**
  *
@@ -94,25 +95,25 @@
         context.internalBind(ENV + name, value);
     }
 
-    public void addResourceRef(String name, Class iface, RefAdapter refAdapter) throws NamingException {
+    public void addResourceRef(String name, Class iface, GerLocalRefType localRef) throws NamingException {
         if (iface == URL.class) {
             try {
-                context.internalBind(ENV + name, new URL(refAdapter.getExternalUri()));
+                context.internalBind(ENV + name, new URL(localRef.getExternalUri()));
             } catch (MalformedURLException e) {
-                throw (NamingException) new NamingException("Could not convert " + refAdapter + " to URL").initCause(e);
+                throw (NamingException) new NamingException("Could not convert " + localRef + " to URL").initCause(e);
             }
         } else {
             try {
-                bind(name, referenceFactory.buildConnectionFactoryReference(refAdapter, iface));
+                bind(name, referenceFactory.buildConnectionFactoryReference(localRef, iface));
             } catch (MalformedObjectNameException e) {
                 throw (NamingException) new NamingException("invalid object name").initCause(e);
             }
         }
     }
 
-    public void addResourceEnvRef(String name, Class iface, RefAdapter refAdapter) throws NamingException {
+    public void addResourceEnvRef(String name, Class iface, GerLocalRefType localRef) throws NamingException {
         try {
-            bind(name, referenceFactory.buildAdminObjectReference(refAdapter, iface));
+            bind(name, referenceFactory.buildAdminObjectReference(localRef, iface));
         } catch (MalformedObjectNameException e) {
             throw (NamingException) new NamingException("invalid object name").initCause(e);
         }
@@ -127,17 +128,17 @@
         }
     }
 
-    public void addEjbRef(String name, Class iface, RefAdapter refAdapter) throws NamingException {
+    public void addEjbRef(String name, Class iface, GerRemoteRefType remoteRef) throws NamingException {
         try {
-            bind(name, referenceFactory.buildEjbReference(refAdapter, iface));
+            bind(name, referenceFactory.buildEjbReference(remoteRef, iface));
         } catch (MalformedObjectNameException e) {
             throw (NamingException) new NamingException("invalid object name").initCause(e);
         }
     }
 
-    public void addEjbLocalRef(String name, Class iface, RefAdapter refAdapter) throws NamingException {
+    public void addEjbLocalRef(String name, Class iface, GerLocalRefType localRef) throws NamingException {
         try {
-            bind(name, referenceFactory.buildEjbLocalReference(refAdapter, iface));
+            bind(name, referenceFactory.buildEjbLocalReference(localRef, iface));
         } catch (MalformedObjectNameException e) {
             throw (NamingException) new NamingException("invalid object name").initCause(e);
         }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java	Fri Sep 24 00:08:10 2004
@@ -21,8 +21,9 @@
 import javax.management.ObjectName;
 import javax.naming.Reference;
 
-import org.apache.geronimo.naming.deployment.RefAdapter;
 import org.apache.geronimo.naming.ReferenceFactory;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
 
 /**
  *
@@ -39,15 +40,15 @@
     public JMXReferenceFactory() {
     }
 
-    public Reference buildConnectionFactoryReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException {
+    public Reference buildConnectionFactoryReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException {
         Reference ref = new Reference(null, JMXObjectFactory.class.getName(), null);
-        ref.add(new JMXRefAddr(refAdapter.getServerName(), refAdapter.getKernelName(), ObjectName.getInstance(BASE_MANAGED_CONNECTION_FACTORY_NAME + refAdapter.getTargetName()), iface));
+        ref.add(new JMXRefAddr(localRef.getServer(), localRef.getKernelName(), ObjectName.getInstance(BASE_MANAGED_CONNECTION_FACTORY_NAME + localRef.getTargetName()), iface));
         return ref;
     }
 
-    public Reference buildAdminObjectReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException {
+    public Reference buildAdminObjectReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException {
         Reference ref = new Reference(null, JMXObjectFactory.class.getName(), null);
-        ref.add(new JMXRefAddr(refAdapter.getServerName(), refAdapter.getKernelName(), ObjectName.getInstance(BASE_ADMIN_OBJECT_NAME + refAdapter.getTargetName()), iface));
+        ref.add(new JMXRefAddr(localRef.getServer(), localRef.getKernelName(), ObjectName.getInstance(BASE_ADMIN_OBJECT_NAME + localRef.getTargetName()), iface));
         return ref;
     }
 
@@ -58,15 +59,15 @@
         return ref;
     }
 
-    public Reference buildEjbReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException {
+    public Reference buildEjbReference(GerRemoteRefType remoteRef, Class iface) throws MalformedObjectNameException {
         Reference ref = new Reference(null, JMXObjectFactory.class.getName(), null);
-        ref.add(new JMXRefAddr(refAdapter.getServerName(), refAdapter.getKernelName(), ObjectName.getInstance(refAdapter.getTargetName()), iface));
+        ref.add(new JMXRefAddr(remoteRef.getServer(), remoteRef.getKernelName(), ObjectName.getInstance(remoteRef.getTargetName()), iface));
         return ref;
     }
 
-    public Reference buildEjbLocalReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException {
+    public Reference buildEjbLocalReference(GerLocalRefType localRef, Class iface) throws MalformedObjectNameException {
         Reference ref = new Reference(null, JMXObjectFactory.class.getName(), null);
-        ref.add(new JMXRefAddr(refAdapter.getServerName(), refAdapter.getKernelName(), ObjectName.getInstance(refAdapter.getTargetName()), iface));
+        ref.add(new JMXRefAddr(localRef.getServer(), localRef.getKernelName(), ObjectName.getInstance(localRef.getTargetName()), iface));
         return ref;
     }
 

Modified: geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd
==============================================================================
--- geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd	(original)
+++ geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd	Fri Sep 24 00:08:10 2004
@@ -17,7 +17,8 @@
 -->
   
 <xsd:schema
-    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+    targetNamespace="http://geronimo.apache.org/xml/ns/naming"
+    xmlns:gernaming="http://geronimo.apache.org/xml/ns/naming"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
@@ -33,7 +34,7 @@
         </xsd:documentation>
     </xsd:annotation>
 
-    <xsd:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="j2ee_1_4.xsd"/>
+    <!--xsd:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="j2ee_1_4.xsd"/-->
 
     <xsd:group name="jndiEnvironmentRefsGroup">
         <xsd:annotation>
@@ -49,18 +50,18 @@
                 type="env-entryType"
                 minOccurs="0" maxOccurs="unbounded"/-->
             <xsd:element name="ejb-ref"
-                type="remote-refType"
+                type="gernaming:remote-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
             <xsd:element name="ejb-local-ref"
-                type="local-refType"
+                type="gernaming:local-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
             <!-- leave web services out until I know what they do -->
             <!--xsd:group ref="service-refGroup"/-->
             <xsd:element name="resource-ref"
-                type="local-refType"
+                type="gernaming:local-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
             <xsd:element name="resource-env-ref"
-                type="local-refType"
+                type="gernaming:local-refType"
                 minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
     </xsd:group>
@@ -81,7 +82,7 @@
 
     <xsd:complexType name="local-refType">
         <xsd:complexContent>
-            <xsd:restriction base="remote-refType">
+            <xsd:restriction base="gernaming:remote-refType">
                 <xsd:sequence>
                     <xsd:element name="ref-name" type="xsd:string"/>
                     <xsd:choice>

Modified: geronimo/trunk/modules/naming/src/schema/xmlconfig.xml
==============================================================================
--- geronimo/trunk/modules/naming/src/schema/xmlconfig.xml	(original)
+++ geronimo/trunk/modules/naming/src/schema/xmlconfig.xml	Fri Sep 24 00:08:10 2004
@@ -1,8 +1,8 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config"
     >
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee">
-        <xb:package>org.apache.geronimo.xbeans.geronimo</xb:package>
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.naming</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 

Modified: geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java	(original)
+++ geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java	Fri Sep 24 00:08:10 2004
@@ -22,7 +22,6 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-
 import javax.management.ObjectName;
 import javax.naming.NameClassPair;
 import javax.naming.NamingEnumeration;
@@ -33,14 +32,11 @@
 import org.apache.geronimo.gbean.GBeanInfoFactory;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.naming.deployment.RefAdapter;
-import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
 import org.apache.geronimo.naming.ReferenceFactory;
-import org.apache.xmlbeans.XmlObject;
+import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 
 /**
- *
- *
  * @version $Rev$ $Date$
  */
 public class ContextBuilderTest extends TestCase {
@@ -110,50 +106,12 @@
 
     public void testResourceEnv() throws Exception {
         proxy = new ArrayList();
-        builder.addResourceEnvRef("resourceenvref", List.class, new RefAdapter() {
-            public XmlObject getXmlObject() {
-                return null;
-            }
-
-            public void setXmlObject(XmlObject xmlObject) {
-            }
-
-            public String getRefName() {
-                return "resourceenvref";
-            }
-
-            public void setRefName(String name) {
-            }
-
-            public String getServerName() {
-                return null;
-            }
-
-            public void setServerName(String serverName) {
-            }
-
-            public String getKernelName() {
-                return "test.kernel";
-            }
-
-            public void setKernelName(String kernelName) {
-            }
-
-            public String getTargetName() {
-                return "testAdminObject";
-            }
-
-            public void setTargetName(String targetName) {
-            }
-
-            public String getExternalUri() {
-                return null;
-            }
-
-            public void setExternalUri(String externalURI) {
-            }
+        GerLocalRefType localRef = GerLocalRefType.Factory.newInstance();
+        localRef.setRefName("resourceenvref");
+        localRef.setKernelName("test.kernel");
+        localRef.setTargetName("testAdminObject");
+        builder.addResourceEnvRef("resourceenvref", List.class, localRef);
 
-        });
         ReadOnlyContext roc = builder.getContext();
         Kernel kernel = new Kernel("test.kernel", "test.domain");
         kernel.boot();
@@ -195,7 +153,7 @@
         GBeanInfoFactory infoFactory = new GBeanInfoFactory(TestProxyFactory.class);
         infoFactory.addAttribute("Content", Object.class, true);
         infoFactory.addOperation("getProxy");
-        infoFactory.setConstructor(new String[] {"Content"});
+        infoFactory.setConstructor(new String[]{"Content"});
         return infoFactory.getBeanInfo();
     }
 }

Mime
View raw message