geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r512759 - /geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Date Wed, 28 Feb 2007 14:04:57 GMT
Author: sppatel
Date: Wed Feb 28 06:04:56 2007
New Revision: 512759

URL: http://svn.apache.org/viewvc?view=rev&rev=512759
Log:
tolerate no app client dd

Modified:
    geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&rev=512759&r1=512758&r2=512759
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Wed Feb 28 06:04:56 2007
@@ -200,8 +200,8 @@
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
         assert (earName == null) == (earEnvironment == null): "if earName is not null you
must supply earEnvironment as well";
 
-        String specDD;
-        ApplicationClientType appClient;
+        String specDD = null;
+        ApplicationClientType appClient = null;
         try {
             if (specDDUrl == null) {
                 specDDUrl = DeploymentUtil.createJarURL(moduleFile, "META-INF/application-client.xml");
@@ -210,18 +210,25 @@
             // read in the entire specDD as a string, we need this for getDeploymentDescriptor
             // on the J2ee management object
             specDD = DeploymentUtil.readAll(specDDUrl);
-        } catch (Exception e) {
-            //no application-client.xml, not for us.
-            return null;
-        }
-        //we found application-client.xml, if it won't parse it's an error.
-        try {
-            // parse it
+            
+            //we found application-client.xml, if it won't parse it's an error.
             XmlObject xmlObject = XmlBeansUtil.parse(specDD);
             ApplicationClientDocument appClientDoc = convertToApplicationClientSchema(xmlObject);
             appClient = appClientDoc.getApplicationClient();
         } catch (XmlException e) {
             throw new DeploymentException("Unable to parse application-client.xml", e);
+        } catch (Exception e) {
+            //no application-client.xml
+        	try {
+				Manifest manifest = moduleFile.getManifest();
+				if(manifest == null || manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS)
== null) {
+					//not for us
+					return null;
+				}
+			} catch (IOException e2) {
+				throw new DeploymentException(e2);
+			}
+			//continue processing considering this as an annotated app-client module with no spec
dd
         }
 
         // parse vendor dd



Mime
View raw message