tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1291835 - /openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java
Date Tue, 21 Feb 2012 15:01:52 GMT
Author: rmannibucau
Date: Tue Feb 21 15:01:51 2012
New Revision: 1291835

URL: http://svn.apache.org/viewvc?rev=1291835&view=rev
Log:
fixing NPE when we don't find the webapp from the listener

Modified:
    openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java

Modified: openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java?rev=1291835&r1=1291834&r2=1291835&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/OpenEJBListener.java
Tue Feb 21 15:01:51 2012
@@ -70,12 +70,14 @@ public class OpenEJBListener implements 
             if (webappDir == null && event.getSource() instanceof StandardServer)
{
                 final StandardServer server = (StandardServer) event.getSource();
                 webappDir = tryToFindAndExtractWar(server);
-                final File exploded = extractDirectory(webappDir);
-                if (webappDir != null) {
-                    extract(webappDir, exploded);
+                if (webappDir != null) { // we are using webapp startup
+                    final File exploded = extractDirectory(webappDir);
+                    if (webappDir != null) {
+                        extract(webappDir, exploded);
+                    }
+                    webappDir = exploded;
+                    TomcatHelper.setServer(server);
                 }
-                webappDir = exploded;
-                TomcatHelper.setServer(server);
             }
             if (webappDir != null) {
                 final Properties properties = new Properties();
@@ -93,7 +95,7 @@ public class OpenEJBListener implements 
         }
     }
 
-    private File extractDirectory(final File webappDir) {
+    private static File extractDirectory(final File webappDir) {
         File exploded = new File(webappDir.getAbsolutePath().replace(".war", ""));
         int i = 0;
         while (exploded.exists()) {



Mime
View raw message