geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r292376 [3/4] - in /geronimo/branches/1.0-M5: ./ applications/console-ear/src/plan/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/ applications/console-standard/src/java/org/apache/geronimo/console/jmsma...
Date Thu, 29 Sep 2005 02:08:52 GMT
Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Wed Sep 28 19:07:10 2005
@@ -29,6 +29,7 @@
 import java.security.PermissionCollection;
 import java.security.Permissions;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -40,10 +41,8 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.security.jacc.WebResourcePermission;
@@ -51,16 +50,16 @@
 import javax.security.jacc.WebUserDataPermission;
 import javax.servlet.Servlet;
 import javax.transaction.UserTransaction;
-import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -89,11 +88,11 @@
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.security.util.URLPattern;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
-import org.apache.geronimo.xbeans.geronimo.web.jetty.GerJettyConfigType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
 import org.apache.geronimo.xbeans.j2ee.DispatcherType;
 import org.apache.geronimo.xbeans.j2ee.ErrorPageType;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
@@ -105,6 +104,7 @@
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingListType;
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingType;
 import org.apache.geronimo.xbeans.j2ee.LoginConfigType;
+import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.MimeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ParamValueType;
 import org.apache.geronimo.xbeans.j2ee.RoleNameType;
@@ -119,7 +119,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
 import org.apache.geronimo.xbeans.j2ee.WelcomeFileListType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
+import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.mortbay.http.BasicAuthenticator;
@@ -148,9 +148,7 @@
 
     private final Repository repository;
     private final Kernel kernel;
-    private static final String JETTY_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/jetty";
-    private static final QName JETTY_CONFIG_QNAME = new QName(JETTY_CONFIG_NAMESPACE, "jetty");
-    private static final String JETTY_NAMESPACE = JETTY_CONFIG_NAMESPACE;//GerConnectorDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();//GerConnectorDocument.type.getDocumentElementName().getNamespaceURI();
 
     public JettyModuleBuilder(URI[] defaultParentId,
                               Integer defaultSessionTimeoutSeconds,
@@ -164,7 +162,7 @@
                               WebServiceBuilder webServiceBuilder,
                               Repository repository,
                               Kernel kernel) throws GBeanNotFoundException {
-        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
 
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
@@ -222,7 +220,7 @@
         //we found web.xml, if it won't parse that's an error.
         try {
             // parse it
-            XmlObject parsed = SchemaConversionUtils.parse(specDD);
+            XmlObject parsed = XmlBeansUtil.parse(specDD);
             WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {
@@ -231,7 +229,7 @@
         check(webApp);
 
         // parse vendor dd
-        GerWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
+        JettyWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
         if (contextRoot == null) {
             if (jettyWebApp.isSetContextRoot()) {
                 contextRoot = jettyWebApp.getContextRoot();
@@ -263,7 +261,7 @@
         if (parentId.isEmpty()) {
             parentId = new ArrayList(defaultParentId);
         }
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap);
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
         return module;
     }
 
@@ -287,58 +285,54 @@
         return map;
     }
 
-    GerWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
-        GerWebAppType jettyWebApp = null;
+    JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
+        XmlObject rawPlan = null;
         try {
             // load the geronimo-web.xml from either the supplied plan or from the earFile
             try {
                 if (plan instanceof XmlObject) {
-                    XmlObject object = SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
-                    jettyWebApp = TemporaryPlanAdapter.convertJettyElementToWeb(object);
+                    rawPlan = (XmlObject) plan;//SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
                 } else {
-                    GerWebAppDocument jettyWebAppdoc = null;
                     if (plan != null) {
-                        XmlObject object = SchemaConversionUtils.parse(((File) plan).toURL());
-                        jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
+                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL());
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                         try {
-                            jettyWebAppdoc = GerWebAppDocument.Factory.parse(path);
+                            rawPlan = XmlBeansUtil.parse(path);
                         } catch (FileNotFoundException e) {
                             path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
                             try {
-                                XmlObject object = SchemaConversionUtils.parse(path);
-                                if (object != null) {
-                                    log.error("Incorrect deployment plan naming: found geronimo-jetty.xml, should be geronimo-web.xml");
-                                    jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
-                                }
+                                rawPlan = XmlBeansUtil.parse(path);
                             } catch (FileNotFoundException e1) {
                                 log.warn("Web application does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
                             }
                         }
                     }
-                    if (jettyWebAppdoc != null) {
-                        jettyWebApp = jettyWebAppdoc.getWebApp();
-                    }
                 }
             } catch (IOException e) {
                 log.warn(e);
             }
 
-            // if we got one extract and validate it otherwise create a default one
-            if (jettyWebApp != null) {
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoNamingSchema(jettyWebApp);
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoSecuritySchema(jettyWebApp);
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoServiceSchema(jettyWebApp);
-                SchemaConversionUtils.validateDD(jettyWebApp);
+            JettyWebAppType jettyWebApp = null;
+            if (rawPlan != null) {
+                XmlCursor cursor = rawPlan.newCursor();
+                try {
+                    new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
+                            JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+                    SchemaConversionUtils.findNestedElement(cursor, "web-app");
+                    jettyWebApp = (JettyWebAppType) cursor.getObject().copy().changeType(JettyWebAppType.type);
+                    SchemaConversionUtils.validateDD(jettyWebApp);
+                } finally {
+                    cursor.dispose();
+                }
             } else {
                 String defaultContextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
                 jettyWebApp = createDefaultPlan(defaultContextRoot);
             }
+            return jettyWebApp;
         } catch (XmlException e) {
             throw new DeploymentException("xml problem", e);
         }
-        return jettyWebApp;
     }
 
     private String determineDefaultContextRoot(WebAppType webApp, boolean isStandAlone, JarFile moduleFile, String targetPath) {
@@ -372,8 +366,8 @@
         return path;
     }
 
-    private GerWebAppType createDefaultPlan(String contextRoot) {
-        GerWebAppType jettyWebApp = GerWebAppType.Factory.newInstance();
+    private JettyWebAppType createDefaultPlan(String contextRoot) {
+        JettyWebAppType jettyWebApp = JettyWebAppType.Factory.newInstance();
 
         // set the parentId, configId and context root
         jettyWebApp.setConfigId(contextRoot);
@@ -406,7 +400,7 @@
             earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
 
             // add the dependencies declared in the geronimo-web.xml file
-            GerWebAppType jettyWebApp = (GerWebAppType) module.getVendorDD();
+            JettyWebAppType jettyWebApp = (JettyWebAppType) module.getVendorDD();
             DependencyType[] dependencies = jettyWebApp.getDependencyArray();
             ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
         } catch (IOException e) {
@@ -419,7 +413,7 @@
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         WebAppType webApp = (WebAppType) module.getSpecDD();
         MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
-        GerWebAppType gerWebApp = (GerWebAppType) module.getVendorDD();
+        JettyWebAppType gerWebApp = (JettyWebAppType) module.getVendorDD();
         GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
 
         ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations);
@@ -431,7 +425,7 @@
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
-        GerWebAppType jettyWebApp = (GerWebAppType) webModule.getVendorDD();
+        JettyWebAppType jettyWebApp = (JettyWebAppType) webModule.getVendorDD();
 
         boolean contextPriorityClassLoader = defaultContextPriorityClassloader;
         if (jettyWebApp.isSetContextPriorityClassloader()) {
@@ -467,21 +461,11 @@
 
             webModuleData.setAttribute("uri", URI.create(module.getTargetPath() + "/"));
 
-            if (jettyWebApp.isSetContainerConfig()) {
-                GerContainerConfigType containerConfig = jettyWebApp.getContainerConfig();
-                XmlObject[] anys = containerConfig.selectChildren(JETTY_CONFIG_QNAME);
-                if (anys.length > 1) {
-                    throw new DeploymentException("More than one jetty configuration element: " + anys);
-                }
-                if (anys.length == 1) {
-                    GerJettyConfigType jettyConfigType = (GerJettyConfigType) anys[0].copy().changeType(GerJettyConfigType.type);
-                    String[] hosts = jettyConfigType.getVirtualHostArray();
-                    for (int i = 0; i < hosts.length; i++) {
-                        hosts[i] = hosts[i].trim();
-                    }
-                    webModuleData.setAttribute("virtualHosts", hosts);
-                }
+            String[] hosts = jettyWebApp.getVirtualHostArray();
+            for (int i = 0; i < hosts.length; i++) {
+                hosts[i] = hosts[i].trim();
             }
+            webModuleData.setAttribute("virtualHosts", hosts);
 
             webModuleData.setAttribute("componentContext", compContext);
             webModuleData.setAttribute("userTransaction", userTransaction);
@@ -1274,7 +1258,7 @@
         }
     }
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, GerWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
         return ENCConfigBuilder.buildComponentContext(earContext,
                 earContext,
                 webModule,

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/schema/xmlconfig.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/schema/xmlconfig.xml Wed Sep 28 19:07:10 2005
@@ -17,8 +17,12 @@
 -->
 <!-- @version $Rev: 57116 $ $Date: 2004-11-09 18:34:38 -0700 (Tue, 09 Nov 2004) $ -->
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/jetty">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web.jetty</xb:package>
+        <xb:prefix>Jetty</xb:prefix>
+    </xb:namespace>
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/jetty/config-1.0">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.web.jetty.config</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 </xb:config>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
 -->
 
 <jetty:web-app
-    xmlns:jetty="http://geronimo.apache.org/xml/ns/web"
+    xmlns:jetty="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="org/apache/geronimo/jetty/Test"
     >
     <jetty:context-root>/test</jetty:context-root>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,8 +17,8 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,20 +17,20 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>demo-properties-realm</security-realm-name>
     <sec:security>
         <sec:default-principal realm-name="demo-properties-realm">
             <sec:principal class="org.apache.geronimo.security.realm.providers.PropertiesFileUserPrincipal" name="izumi"/>
         </sec:default-principal>
     </sec:security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan1.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan1.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan1.xml Wed Sep 28 19:07:10 2005
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">
         <default-principal realm-name="public-properties-realm">
@@ -41,8 +45,4 @@
             </role>
         </role-mappings>
     </security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan2.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan2.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan2.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan2.xml Wed Sep 28 19:07:10 2005
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">
         <default-principal realm-name="public-properties-realm">
@@ -41,8 +45,4 @@
             </role>
         </role-mappings>
     </security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan3.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan3.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan3.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan3.xml Wed Sep 28 19:07:10 2005
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
 

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan4.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan4.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan4.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test-resources/plans/plan4.xml Wed Sep 28 19:07:10 2005
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
 
     <context-priority-classloader>true</context-priority-classloader>
 
     <container-config>
-        <jetty xmlns="http://geronimo.apache.org/xml/ns/web/jetty">
+        <jetty xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0/config">
             <virtual-host>foo</virtual-host>
             <virtual-host>bar</virtual-host>
         </jetty>

Modified: geronimo/branches/1.0-M5/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/1.0-M5/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Wed Sep 28 19:07:10 2005
@@ -3,19 +3,28 @@
 import java.io.File;
 import java.net.URI;
 import java.util.HashSet;
+import java.util.List;
+import java.util.ArrayList;
 import java.util.jar.JarFile;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor;
 
 /**
  */
@@ -27,21 +36,45 @@
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(new URI[] {URI.create("defaultParent")}, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
+        builder = new JettyModuleBuilder(new URI[]{URI.create("defaultParent")}, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
     }
 
     public void testContents() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
         assertTrue(resourcePlan.exists());
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
         assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
+    public void testMoveSecurity1() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1A.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(1, jettyWebApp.getResourceRefArray().length);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+    }
+
+    public void testMoveSecurity2() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1B.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(1, jettyWebApp.getResourceRefArray().length);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+    }
+
+    public void testMoveSecurity3() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1C.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        System.out.println(jettyWebApp.xmlText());
+    }
+
     public void testOldFormat() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan2.xml");
         assertTrue(resourcePlan.exists());
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
         assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
@@ -50,39 +83,39 @@
         File war = new File(basedir, "src/test-resources/deployables/war5");
         assertTrue(war.exists());
         UnpackedJarFile moduleFile = new UnpackedJarFile(war);
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
         moduleFile.close();
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
     }
 
-    public void testOldFormatPackaged() throws Exception {
+    public void XtestOldFormatPackaged() throws Exception {
         File war = new File(basedir, "src/test-resources/deployables/war6.war");
         assertTrue(war.exists());
         JarFile moduleFile = new JarFile(war);
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
         moduleFile.close();
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
     }
 
     public void testConstructPlan() throws Exception {
-        GerWebAppDocument jettyWebAppDoc = GerWebAppDocument.Factory.newInstance();
-        GerWebAppType GerWebAppType = jettyWebAppDoc.addNewWebApp();
-        GerWebAppType.setConfigId("configId");
-        GerWebAppType.setParentId("parentId");
-        GerWebAppType.setContextPriorityClassloader(false);
-        GerResourceRefType ref = GerWebAppType.addNewResourceRef();
+        JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
+        JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
+        webApp.setConfigId("configId");
+        webApp.setParentId("parentId");
+        webApp.setContextPriorityClassloader(false);
+        GerResourceRefType ref = webApp.addNewResourceRef();
         ref.setRefName("ref");
         ref.setTargetName("target");
 
-        SchemaConversionUtils.validateDD(GerWebAppType);
-        System.out.println(GerWebAppType.toString());
+        SchemaConversionUtils.validateDD(webApp);
+        System.out.println(webApp.toString());
     }
 
     public void testContextPriorityClassloader() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan3.xml");
         assertTrue(resourcePlan.exists());
 
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
         assertFalse(jettyWebApp.getContextPriorityClassloader());
     }
 
@@ -90,31 +123,31 @@
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan4.xml");
         assertTrue(resourcePlan.exists());
 
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
         assertTrue(jettyWebApp.getContextPriorityClassloader());
 
     }
 
     public void testContextRootWithPlanAndContextSet() throws Exception {
 
-        GerWebAppDocument jettyWebAppDoc = GerWebAppDocument.Factory.newInstance();
-        GerWebAppType GerWebAppType = jettyWebAppDoc.addNewWebApp();
-        GerWebAppType.setConfigId("myId");
-        GerWebAppType.setContextRoot("myContextRoot");
-        GerWebAppType.setContextPriorityClassloader(false);
+        JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
+        JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
+        webApp.setConfigId("myId");
+        webApp.setContextRoot("myContextRoot");
+        webApp.setContextPriorityClassloader(false);
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
 
-        GerWebAppType = builder.getJettyWebApp(GerWebAppType, dummyFile, true, null, null);
+        webApp = builder.getJettyWebApp(webApp, dummyFile, true, null, null);
 
-        assertEquals("myContextRoot", GerWebAppType.getContextRoot());
+        assertEquals("myContextRoot", webApp.getContextRoot());
 
     }
 
     public void testContextRootWithoutPlanStandAlone() throws Exception {
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, true, null, null);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, true, null, null);
 
         assertEquals("war2", GerWebAppType.getContextRoot());
 
@@ -123,7 +156,7 @@
     public void testContextRootWithoutPlanAndTargetPath() throws Exception {
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", null);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", null);
 
         assertEquals("myTargetPath", GerWebAppType.getContextRoot());
 
@@ -136,13 +169,68 @@
         webAppType.setId("myId");
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", webAppType);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", webAppType);
 
         assertEquals("myId", GerWebAppType.getContextRoot());
 
     }
 
-     public void testParseSpecDD() {
+    public void testParseSpecDD() {
+
+    }
 
+    public void testConvertToJettySchema() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan4.xml");
+        assertTrue(resourcePlan.exists());
+        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlCursor cursor = plan.newCursor();
+        try {
+        new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
+                JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+        } finally {
+            cursor.dispose();
+        }
+        File ConvertedPlan = new File(basedir, "src/test-resources/plans/plan4-converted.xml");
+        assertTrue(ConvertedPlan.exists());
+        XmlObject converted = XmlBeansUtil.parse(ConvertedPlan.toURL());
+        XmlCursor c = converted.newCursor();
+        SchemaConversionUtils.findNestedElement(c, "web-app");
+        ArrayList problems = new ArrayList();
+        compareXmlObjects(plan, c, problems);
+        assertEquals("problems: " + problems, 0, problems.size());
+    }
+
+    private boolean compareXmlObjects(XmlObject xmlObject, XmlCursor expected, List problems) {
+        XmlCursor test = xmlObject.newCursor();
+        boolean similar = true;
+        int elementCount = 0;
+        while (toNextStartToken(test)) {
+            elementCount++;
+            if (!toNextStartToken(expected)) {
+                problems.add("test longer than expected at element: " + elementCount);
+                return false;
+            }
+            String actualChars = test.getName().getLocalPart();
+            String expectedChars = expected.getName().getLocalPart();
+            if (!actualChars.equals(expectedChars)) {
+                problems.add("Different elements at elementCount: " + elementCount + ", test: " + actualChars + ", expected: " + expectedChars);
+                similar = false;
+            }
+            test.toNextToken();
+            expected.toNextToken();
+        }
+        return similar;
+    }
+
+    private boolean toNextStartToken(XmlCursor cursor) {
+        while (!cursor.isStart()) {
+            if (!cursor.hasNextToken()) {
+                return false;
+            }
+            cursor.toNextToken();
+        }
+        return true;
     }
+
+
 }

Modified: geronimo/branches/1.0-M5/modules/jetty/src/etc/META-INF/geronimo-service.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty/src/etc/META-INF/geronimo-service.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty/src/etc/META-INF/geronimo-service.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty/src/etc/META-INF/geronimo-service.xml Wed Sep 28 19:07:10 2005
@@ -18,7 +18,7 @@
 
 
 <!--dependencies for jetty-->
-<service xmlns="http://geronimo.apache.org/xml/ns/deployment">
+<service xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0">
 
     <dependency>
         <uri>jetty/jars/org.mortbay.jetty-${jetty_version}.jar</uri>

Modified: geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
 -->
 
 <jetty:web-app
-    xmlns:jetty="http://geronimo.apache.org/xml/ns/web/jetty"
+    xmlns:jetty="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="org/apache/geronimo/jetty/Test"
     >
     <jetty:context-root>/test</jetty:context-root>

Modified: geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/1.0-M5/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,8 +17,8 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>

Modified: geronimo/branches/1.0-M5/modules/naming-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/naming-builder/maven.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/naming-builder/maven.xml (original)
+++ geronimo/branches/1.0-M5/modules/naming-builder/maven.xml Wed Sep 28 19:07:10 2005
@@ -24,7 +24,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-naming.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-naming-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Propchange: geronimo/branches/1.0-M5/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.0-M5/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd
------------------------------------------------------------------------------
    svn:keywords = author date id rev

Modified: geronimo/branches/1.0-M5/modules/naming-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/naming-builder/src/schema/xmlconfig.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/naming-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.0-M5/modules/naming-builder/src/schema/xmlconfig.xml Wed Sep 28 19:07:10 2005
@@ -1,7 +1,7 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config"
     >
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.naming</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/branches/1.0-M5/modules/security-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/security-builder/maven.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/security-builder/maven.xml (original)
+++ geronimo/branches/1.0-M5/modules/security-builder/maven.xml Wed Sep 28 19:07:10 2005
@@ -31,7 +31,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-security.xsd,schema/geronimo-login-config.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-security-1.0.xsd,schema/geronimo-login-config-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/branches/1.0-M5/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java (original)
+++ geronimo/branches/1.0-M5/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java Wed Sep 28 19:07:10 2005
@@ -47,7 +47,7 @@
  * @version $Rev:  $ $Date:  $
  */
 public class LoginConfigBuilder implements XmlReferenceBuilder {
-    public static final String LOGIN_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/loginconfig";
+    public static final String LOGIN_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/loginconfig-1.0";
 
     public String getNamespace() {
         return LOGIN_CONFIG_NAMESPACE;

Propchange: geronimo/branches/1.0-M5/modules/security-builder/src/schema/geronimo-security-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.0-M5/modules/security-builder/src/schema/geronimo-security-1.0.xsd
------------------------------------------------------------------------------
    svn:keywords = author date id rev

Modified: geronimo/branches/1.0-M5/modules/security-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/security-builder/src/schema/xmlconfig.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/security-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.0-M5/modules/security-builder/src/schema/xmlconfig.xml Wed Sep 28 19:07:10 2005
@@ -1,11 +1,11 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/security">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/security-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.security</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.loginconfig</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/branches/1.0-M5/modules/security/src/test-data/xml/deployment/geronimo-security.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/security/src/test-data/xml/deployment/geronimo-security.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/security/src/test-data/xml/deployment/geronimo-security.xml (original)
+++ geronimo/branches/1.0-M5/modules/security/src/test-data/xml/deployment/geronimo-security.xml Wed Sep 28 19:07:10 2005
@@ -6,19 +6,19 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-  
+
 <security xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://geronimo.apache.org/xml/ns/security"
+         xmlns="http://geronimo.apache.org/xml/ns/security-1.0"
          version="1.0">
     <default-principal>
         <principal>

Modified: geronimo/branches/1.0-M5/modules/service-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/service-builder/maven.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/service-builder/maven.xml (original)
+++ geronimo/branches/1.0-M5/modules/service-builder/maven.xml Wed Sep 28 19:07:10 2005
@@ -24,7 +24,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-config.xsd,schema/geronimo-service.xsd,schema/geronimo-javabean-xmlattribute.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-config-1.0.xsd,schema/geronimo-service-1.0.xsd,schema/geronimo-javabean-xmlattribute-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java (original)
+++ geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java Wed Sep 28 19:07:10 2005
@@ -37,7 +37,7 @@
  */
 public class JavaBeanXmlAttributeBuilder implements XmlAttributeBuilder {
 
-    private static final String NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment/javabean";
+    private static final String NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0";
 
     public String getNamespace() {
         return NAMESPACE;

Modified: geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/branches/1.0-M5/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Wed Sep 28 19:07:10 2005
@@ -30,12 +30,8 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.jar.JarFile;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -44,6 +40,8 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.AttributeType;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
@@ -61,7 +59,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -69,7 +66,6 @@
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
 
 /**
  * @version $Rev$ $Date$
@@ -84,7 +80,8 @@
     private static final Map xmlReferenceBuilderMap = new HashMap();
     private Map attrRefMap;
     private Map refRefMap;
-    private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment", "configuration");
+    private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.0", "configuration");
+
 
     public ServiceConfigBuilder(URI[] defaultParentId, Repository repository) {
         this(defaultParentId, repository, null, null, null);
@@ -121,8 +118,7 @@
         }
 
         try {
-            XmlObject xmlObject = XmlObject.Factory.parse(planFile);
-//            ConfigurationDocument configurationDoc = ConfigurationDocument.Factory.parse(planFile);
+            XmlObject xmlObject = XmlBeansUtil.parse(planFile);
             XmlCursor cursor = xmlObject.newCursor();
             try {
                 cursor.toFirstChild();
@@ -138,11 +134,8 @@
             } else {
                 configurationDoc = (ConfigurationDocument) xmlObject.changeType(ConfigurationDocument.type);
             }
-            XmlOptions xmlOptions = new XmlOptions();
-            xmlOptions.setLoadLineNumbers();
             Collection errors = new ArrayList();
-            xmlOptions.setErrorListener(errors);
-            if (!configurationDoc.validate(xmlOptions)) {
+            if (!configurationDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
                 throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + configurationDoc.toString());
             }
             return configurationDoc.getConfiguration();
@@ -272,8 +265,12 @@
                 // it has a geronimo-service.xml file
                 ServiceDocument serviceDoc = null;
                 try {
-                    serviceDoc = ServiceDocument.Factory.parse(is);
-                } catch (org.apache.xmlbeans.XmlException e) {
+                    Collection errors = new ArrayList();
+                    serviceDoc = ServiceDocument.Factory.parse(is, XmlBeansUtil.createXmlOptions(errors));
+                    if (errors.size() > 0) {
+                        throw new DeploymentException("Invalid service doc: " + errors);
+                    }
+                } catch (XmlException e) {
                     throw new DeploymentException("Invalid geronimo-service.xml file in " + url, e);
                 } catch (IOException e) {
                     throw new DeploymentException("Unable to parse geronimo-service.xml file in " + url, e);

Propchange: geronimo/branches/1.0-M5/modules/service-builder/src/schema/geronimo-config-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.0-M5/modules/service-builder/src/schema/geronimo-config-1.0.xsd
------------------------------------------------------------------------------
    svn:keywords = author date id rev

Propchange: geronimo/branches/1.0-M5/modules/service-builder/src/schema/geronimo-service-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.0-M5/modules/service-builder/src/schema/geronimo-service-1.0.xsd
------------------------------------------------------------------------------
    svn:keywords = author date id rev

Modified: geronimo/branches/1.0-M5/modules/service-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/service-builder/src/schema/xmlconfig.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/service-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.0-M5/modules/service-builder/src/schema/xmlconfig.xml Wed Sep 28 19:07:10 2005
@@ -1,10 +1,10 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment-1.0">
         <xb:package>org.apache.geronimo.deployment.xbeans</xb:package>
     </xb:namespace>
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment/javabean">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0">
         <xb:package>org.apache.geronimo.deployment.javabean.xbeans</xb:package>
     </xb:namespace>
 

Modified: geronimo/branches/1.0-M5/modules/service-builder/src/test-resources/services/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/service-builder/src/test-resources/services/plan1.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/service-builder/src/test-resources/services/plan1.xml (original)
+++ geronimo/branches/1.0-M5/modules/service-builder/src/test-resources/services/plan1.xml Wed Sep 28 19:07:10 2005
@@ -6,19 +6,19 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-  
+
 
 <configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment"
+    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
     configId="test/plan1"
     >
     <dependency>
@@ -26,18 +26,18 @@
         <artifactId>geronimo-kernel</artifactId>
         <version>DEV</version>
     </dependency>
-    
+
     <gbean gbeanName="geronimo.test:name=MyMockGMBean" class="org.apache.geronimo.deployment.MockGBean">
         <attribute name="value">1234</attribute>
         <attribute name="intValue">1234</attribute>
         <xml-attribute name="fooBarBean">
-            <ns:javabean xmlns:ns="http://geronimo.apache.org/xml/ns/deployment/javabean">
+            <ns:javabean xmlns:ns="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0">
                 <ns:property name="Foo">foo</ns:property>
                 <ns:property name="Bar">10</ns:property>
                 <ns:bean-property name="Bean">
                     <ns:javabean>
                         <ns:property name="Foo">foo2</ns:property>
-                        <ns:property name="Bar">100</ns:property>                                          
+                        <ns:property name="Bar">100</ns:property>
                     </ns:javabean>
                 </ns:bean-property>
             </ns:javabean>

Modified: geronimo/branches/1.0-M5/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java (original)
+++ geronimo/branches/1.0-M5/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java Wed Sep 28 19:07:10 2005
@@ -60,7 +60,8 @@
     }
 
     public void serverStartFailed(Exception problem) {
-        System.out.println("Geronimo startup failed");
+        System.out.println("Geronimo startup failed:");
+        problem.printStackTrace(System.out);
     }
 
     public void loadFailed(String configuration, Exception problem) {

Modified: geronimo/branches/1.0-M5/modules/test-ddbean/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/test-ddbean/project.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/test-ddbean/project.xml (original)
+++ geronimo/branches/1.0-M5/modules/test-ddbean/project.xml Wed Sep 28 19:07:10 2005
@@ -66,6 +66,11 @@
                 <xmlbeans>true</xmlbeans>
             </properties>
         </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
     </dependencies>
 
 

Modified: geronimo/branches/1.0-M5/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java (original)
+++ geronimo/branches/1.0-M5/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java Wed Sep 28 19:07:10 2005
@@ -27,7 +27,7 @@
 import javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
 import javax.enterprise.deploy.shared.ModuleType;
 
-import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 
@@ -46,7 +46,7 @@
         try {
             is = descriptor.openStream();
         try {
-        XmlObject xmlObject = SchemaConversionUtils.parse(is);
+        XmlObject xmlObject = XmlBeansUtil.parse(is);
             XmlCursor c = xmlObject.newCursor();
             try {
                 c.toStartDoc();

Modified: geronimo/branches/1.0-M5/modules/tomcat-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/tomcat-builder/maven.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/tomcat-builder/maven.xml (original)
+++ geronimo/branches/1.0-M5/modules/tomcat-builder/maven.xml Wed Sep 28 19:07:10 2005
@@ -28,7 +28,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat-1.0.xsd,schema/geronimo-tomcat-config-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/branches/1.0-M5/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/branches/1.0-M5/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Wed Sep 28 19:07:10 2005
@@ -19,6 +19,7 @@
 
 import java.io.File;
 import java.io.FileFilter;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -27,19 +28,18 @@
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.security.jacc.WebResourcePermission;
@@ -48,12 +48,15 @@
 import javax.transaction.UserTransaction;
 import javax.xml.namespace.QName;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -65,8 +68,8 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
@@ -82,13 +85,14 @@
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
-import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.GerTomcatConfigType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.config.GerTomcatDocument;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
 import org.apache.geronimo.xbeans.j2ee.HttpMethodType;
+import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.RoleNameType;
 import org.apache.geronimo.xbeans.j2ee.SecurityConstraintType;
 import org.apache.geronimo.xbeans.j2ee.SecurityRoleRefType;
@@ -99,7 +103,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
+import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -109,8 +113,7 @@
  */
 public class TomcatModuleBuilder implements ModuleBuilder {
 
-    private static final String TOMCAT_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/tomcat";
-    private static final QName TOMCAT_CONFIG_QNAME = new QName(TOMCAT_CONFIG_NAMESPACE, "tomcat");
+    private static final Log log = LogFactory.getLog(TomcatModuleBuilder.class);
 
     private final List defaultParentId;
     private final boolean defaultContextPriorityClassloader;
@@ -119,22 +122,19 @@
     private final WebServiceBuilder webServiceBuilder;
 
     private final Repository repository;
-    private final Kernel kernel;
-    private static final String TOMCAT_NAMESPACE = TOMCAT_CONFIG_NAMESPACE;//OpenejbOpenejbJarDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
     public TomcatModuleBuilder(URI[] defaultParentId,
                                boolean defaultContextPriorityClassloader,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
-                               Repository repository,
-                               Kernel kernel) {
+                               Repository repository) {
         this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
 
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.tomcatContainerObjectName = tomcatContainerObjectName;
         this.webServiceBuilder = webServiceBuilder;
         this.repository = repository;
-        this.kernel = kernel;
     }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
@@ -168,7 +168,7 @@
         //we found web.xml, if it won't parse that's an error.
         try {
             // parse it
-            XmlObject parsed = SchemaConversionUtils.parse(specDD);
+            XmlObject parsed = XmlBeansUtil.parse(specDD);
             WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {
@@ -178,7 +178,7 @@
 
 
         // parse vendor dd
-        GerWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
+        TomcatWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
 
         // get the ids from either the application plan or for a stand alone module from the specific deployer
         URI configId = null;
@@ -209,7 +209,7 @@
             }
         }
 
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap);
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
         return module;
     }
 
@@ -233,73 +233,92 @@
         return map;
     }
 
-    GerWebAppType getTomcatWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
-        GerWebAppType tomcatWebApp = null;
+    TomcatWebAppType getTomcatWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
+        XmlObject rawPlan = null;
         try {
             // load the geronimo-web.xml from either the supplied plan or from the earFile
             try {
                 if (plan instanceof XmlObject) {
-                    tomcatWebApp = (GerWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
-                            "web-app",
-                            GerWebAppType.type);
+                    rawPlan = (XmlObject) plan;//SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
                 } else {
-                    GerWebAppDocument tomcatWebAppdoc = null;
                     if (plan != null) {
-                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse((File) plan);
+                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL());
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
-                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse(path);
-                    }
-                    if (tomcatWebAppdoc != null) {
-                        tomcatWebApp = tomcatWebAppdoc.getWebApp();
+                        try {
+                            rawPlan = XmlBeansUtil.parse(path);
+                        } catch (FileNotFoundException e) {
+                            path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-tomcat.xml");
+                            try {
+                                rawPlan = XmlBeansUtil.parse(path);
+                            } catch (FileNotFoundException e1) {
+                                log.warn("Web application does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
+                            }
+                        }
                     }
                 }
             } catch (IOException e) {
+                log.warn(e);
             }
 
-            // if we got one extract and validate it otherwise create a default one
-            if (tomcatWebApp != null) {
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoNamingSchema(tomcatWebApp);
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoSecuritySchema(tomcatWebApp);
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoServiceSchema(tomcatWebApp);
-                SchemaConversionUtils.validateDD(tomcatWebApp);
-            } else {
-                String path;
-                if (standAlone) {
-                    // default configId is based on the moduleFile name
-                    path = new File(moduleFile.getName()).getName();
-                } else {
-                    // default configId is based on the module uri from the application.xml
-                    path = targetPath;
+            TomcatWebAppType tomcatWebApp = null;
+            if (rawPlan != null) {
+                XmlCursor cursor = rawPlan.newCursor();
+                try {
+                    new GenericToSpecificPlanConverter(GerTomcatDocument.type.getDocumentElementName().getNamespaceURI(),
+                            TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+                    SchemaConversionUtils.findNestedElement(cursor, "web-app");
+                    tomcatWebApp = (TomcatWebAppType) cursor.getObject().copy().changeType(TomcatWebAppType.type);
+                    SchemaConversionUtils.validateDD(tomcatWebApp);
+                } finally {
+                    cursor.dispose();
                 }
-                tomcatWebApp = createDefaultPlan(path, webApp);
+            } else {
+                String defaultContextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
+                tomcatWebApp = createDefaultPlan(defaultContextRoot);
             }
+            return tomcatWebApp;
         } catch (XmlException e) {
             throw new DeploymentException("xml problem", e);
         }
-        return tomcatWebApp;
     }
 
-    private GerWebAppType createDefaultPlan(String path, WebAppType webApp) {
-        String id = webApp.getId();
-        if (id == null) {
-            id = path;
-            if (id.endsWith(".war")) {
-                id = id.substring(0, id.length() - 4);
-            }
-            if (id.endsWith("/")) {
-                id = id.substring(0, id.length() - 1);
-            }
+    private String determineDefaultContextRoot(WebAppType webApp, boolean isStandAlone, JarFile moduleFile, String targetPath) {
+
+        if (webApp != null && webApp.getId() != null) {
+            return webApp.getId();
         }
 
-        GerWebAppType tomcatWebApp = GerWebAppType.Factory.newInstance();
+        if (isStandAlone) {
+            // default configId is based on the moduleFile name
+            return trimPath(new File(moduleFile.getName()).getName());
+        }
 
-        // set the configId and context root
-        if (null != webApp.getId()) {
-            id = webApp.getId();
+        // default configId is based on the module uri from the application.xml
+        return trimPath(targetPath);
+    }
+
+    private String trimPath(String path) {
+
+        if (path == null) {
+            return null;
         }
-        tomcatWebApp.setConfigId(id);
-        tomcatWebApp.setContextRoot("/" + id);
+
+        if (path.endsWith(".war")) {
+            path = path.substring(0, path.length() - 4);
+        }
+        if (path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+
+        return path;
+    }
+
+    private TomcatWebAppType createDefaultPlan(String path) {
+        TomcatWebAppType tomcatWebApp = TomcatWebAppType.Factory.newInstance();
+        tomcatWebApp.setConfigId(path);
+        tomcatWebApp.setContextRoot("/" + path);
+        tomcatWebApp.setContextPriorityClassloader(defaultContextPriorityClassloader);
         return tomcatWebApp;
     }
 
@@ -327,7 +346,7 @@
             earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
 
             // add the dependencies declared in the geronimo-web.xml file
-            GerWebAppType tomcatWebApp = (GerWebAppType) module.getVendorDD();
+            TomcatWebAppType tomcatWebApp = (TomcatWebAppType) module.getVendorDD();
             DependencyType[] dependencies = tomcatWebApp.getDependencyArray();
             ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
         } catch (IOException e) {
@@ -340,7 +359,7 @@
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         WebAppType webApp = (WebAppType) module.getSpecDD();
         MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
-        GerWebAppType gerWebApp = (GerWebAppType) module.getVendorDD();
+        TomcatWebAppType gerWebApp = (TomcatWebAppType) module.getVendorDD();
         GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
 
         ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations);
@@ -352,7 +371,7 @@
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
-        GerWebAppType tomcatWebApp = (GerWebAppType) webModule.getVendorDD();
+        TomcatWebAppType tomcatWebApp = (TomcatWebAppType) webModule.getVendorDD();
 
         boolean contextPriorityClassLoader = defaultContextPriorityClassloader;
         if (tomcatWebApp != null && tomcatWebApp.isSetContextPriorityClassloader()) {
@@ -407,33 +426,23 @@
             webModuleData.setReferencePattern("Container", tomcatContainerObjectName);
 
             // Process the Tomcat container-config elements
-            if (tomcatWebApp != null && tomcatWebApp.isSetContainerConfig()) {
-                GerContainerConfigType config = tomcatWebApp.getContainerConfig();
-                XmlObject[] anys = config.selectChildren(TOMCAT_CONFIG_QNAME);
-                if (anys.length > 1) {
-                    throw new DeploymentException("More than one tomcat config: " + anys);
-                }
-                if (anys.length == 1) {
-                    GerTomcatConfigType tomcatConfig = (GerTomcatConfigType) anys[0].copy().changeType(GerTomcatConfigType.type);
-                    if (tomcatConfig.isSetHost()) {
-                        String virtualServer = tomcatConfig.getHost().trim();
+                    if (tomcatWebApp.isSetHost()) {
+                        String virtualServer = tomcatWebApp.getHost().trim();
                         webModuleData.setAttribute("virtualServer", virtualServer);
                     }
-                    if (tomcatConfig.isSetCrossContext()) {
+                    if (tomcatWebApp.isSetCrossContext()) {
                         webModuleData.setAttribute("crossContext", Boolean.TRUE);
                     }
-                    if (tomcatConfig.isSetTomcatRealm()) {
-                        String tomcatRealm = tomcatConfig.getTomcatRealm().trim();
+                    if (tomcatWebApp.isSetTomcatRealm()) {
+                        String tomcatRealm = tomcatWebApp.getTomcatRealm().trim();
                         ObjectName realmName = NameFactory.getComponentName(null, null, null, null, tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType(), moduleJ2eeContext);
                         webModuleData.setReferencePattern("TomcatRealm", realmName);
                     }
-                    if (tomcatConfig.isSetValveChain()) {
-                        String valveChain = tomcatConfig.getValveChain().trim();
+                    if (tomcatWebApp.isSetValveChain()) {
+                        String valveChain = tomcatWebApp.getValveChain().trim();
                         ObjectName valveName = NameFactory.getComponentName(null, null, null, null, valveChain, ValveGBean.J2EE_TYPE, moduleJ2eeContext);
                         webModuleData.setReferencePattern("TomcatValveChain", valveName);
                     }
-                }
-            }
 
 
             Map portMap = webModule.getPortMap();
@@ -823,7 +832,7 @@
         }
     }
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, GerWebAppType tomcatWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, TomcatWebAppType tomcatWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
         return ENCConfigBuilder.buildComponentContext(earContext,
                 earContext,
                 webModule,
@@ -951,15 +960,13 @@
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoBuilder.addInterface(ModuleBuilder.class);
-        infoBuilder.addAttribute("kernel", Kernel.class, false);
 
         infoBuilder.setConstructor(new String[]{
             "defaultParentId",
             "defaultContextPriorityClassloader",
             "tomcatContainerObjectName",
             "WebServiceBuilder",
-            "Repository",
-            "kernel"});
+            "Repository"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/branches/1.0-M5/modules/tomcat-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/tomcat-builder/src/schema/xmlconfig.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/tomcat-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.0-M5/modules/tomcat-builder/src/schema/xmlconfig.xml Wed Sep 28 19:07:10 2005
@@ -17,8 +17,12 @@
 -->
 <!-- @version $Rev: 57116 $ $Date: 2004-11-09 18:34:38 -0700 (Tue, 09 Nov 2004) $ -->
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/tomcat">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web.tomcat</xb:package>
+        <xb:prefix>Tomcat</xb:prefix>
+    </xb:namespace>
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.web.tomcat.config</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 </xb:config>

Modified: geronimo/branches/1.0-M5/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0-M5/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml?rev=292376&r1=292375&r2=292376&view=diff
==============================================================================
--- geronimo/branches/1.0-M5/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/1.0-M5/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Wed Sep 28 19:07:10 2005
@@ -6,9 +6,9 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,7 @@
 -->
 
 <tomcat:web-app
-    xmlns:tomcat="http://geronimo.apache.org/xml/ns/web"
+    xmlns:tomcat="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="org/apache/geronimo/tomcat/Test"
     >
     <tomcat:context-root>/test</tomcat:context-root>



Mime
View raw message