geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r778373 - /geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Date Mon, 25 May 2009 10:13:48 GMT
Author: xuhaihong
Date: Mon May 25 10:13:48 2009
New Revision: 778373

URL: http://svn.apache.org/viewvc?rev=778373&view=rev
Log:
GERONIMO-4243 EAR Deploy Error

Modified:
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java?rev=778373&r1=778372&r2=778373&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
(original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Mon May 25 10:13:48 2009
@@ -22,6 +22,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Map;
@@ -150,20 +151,29 @@
         }
         
         URL[] urls = urlList.toArray(new URL[] {});
-        JarFileClassLoader tempClassLoader = new JarFileClassLoader(null, urls, parentClassLoader);
-        ClassFinder classFinder = new ClassFinder(tempClassLoader, urlList);
-
-        List<Class> classes = new ArrayList<Class>();
-
-        classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
-        classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));     
 
-
-        tempClassLoader.destroy();
-
-        if (tmpDir != null) {
-            DeploymentUtil.recursiveDelete(tmpDir);
+        JarFileClassLoader tempClassLoader = null;
+        try {
+            tempClassLoader = new JarFileClassLoader(null, urls, parentClassLoader);
+            List<Class> classes = new ArrayList<Class>();
+            for (URL url : urlList) {
+                try {
+                    ClassFinder classFinder = new ClassFinder(tempClassLoader, Collections.singletonList(url));
+                    classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
+                    classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));
+                } catch (Exception e) {
+                    LOG.warn("Fail to search Web Service in jar [" + url + "]", e);
+                }
+            }
+            return classes;
+        } finally {
+            if (tempClassLoader != null)
+                try {
+                    tempClassLoader.destroy();
+                } catch (Exception e) {
+                }
+            if (tmpDir != null) {
+                DeploymentUtil.recursiveDelete(tmpDir);
+            }
         }
-
-        return classes;
     }
 }



Mime
View raw message