geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r406804 - /geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
Date Tue, 16 May 2006 02:42:31 GMT
Author: ammulder
Date: Mon May 15 19:42:30 2006
New Revision: 406804

URL: http://svn.apache.org/viewcvs?rev=406804&view=rev
Log:
Don't accept Jetty plans for Tomcat or vice versa (GERONIMO-2006).

Modified:
    geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java

Modified: geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java?rev=406804&r1=406803&r2=406804&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
(original)
+++ geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
Mon May 15 19:42:30 2006
@@ -53,6 +53,13 @@
         XmlCursor rawCursor = plan.newCursor();
         try {
             if (SchemaConversionUtils.findNestedElement(rawCursor, "web-app")) {
+                XmlCursor temp = rawCursor.newCursor();
+                String namespace = temp.getName().getNamespaceURI();
+                temp.dispose();
+                if(!namespace.equals(GENERIC_NAMESPACE) && !namespace.equals(this.namespace)
&& !namespace.equals(OLD_GENERIC_NAMESPACE)) {
+                    throw new DeploymentException("Cannot handle web plan with namespace
"+namespace+" -- expecting "+GENERIC_NAMESPACE+" or "+this.namespace);
+                }
+
                 XmlObject webPlan = rawCursor.getObject().copy();
 
                 XmlCursor cursor = webPlan.newCursor();
@@ -80,8 +87,8 @@
                     while (cursor.hasNextToken()) {
                         if (cursor.isStart()) {
                             if (!SchemaConversionUtils.convertSingleElementToGeronimoSubSchemas(cursor,
end)
-                            && !namespace.equals(cursor.getName().getNamespaceURI()))
{
-                                cursor.setName(new QName(namespace, cursor.getName().getLocalPart()));
+                            && !this.namespace.equals(cursor.getName().getNamespaceURI()))
{
+                                cursor.setName(new QName(this.namespace, cursor.getName().getLocalPart()));
                             }
                         }
                         cursor.toNextToken();
@@ -90,7 +97,7 @@
 
                     cursor.pop();
                     cursor.push();
-                    if (cursor.toChild(namespace, "security-realm-name")) {
+                    if (cursor.toChild(this.namespace, "security-realm-name")) {
                         XmlCursor other = cursor.newCursor();
                         try {
                             other.toParent();



Mime
View raw message