You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2017/11/01 17:27:49 UTC

[1/2] tomee git commit: TOMEE-2145 fix double deploy issue when deploying an EAR from the webapps directory

Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x bfdd20c77 -> 4b11c31b7


TOMEE-2145 fix double deploy issue when deploying an EAR from the webapps directory


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/a3150bb3
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/a3150bb3
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/a3150bb3

Branch: refs/heads/tomee-1.7.x
Commit: a3150bb3bc53b3dba31598ef3d71fe5b558c6412
Parents: bfdd20c
Author: Jonathan Gallimore <jo...@jrg.me.uk>
Authored: Wed Nov 1 17:09:07 2017 +0000
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Wed Nov 1 17:16:46 2017 +0000

----------------------------------------------------------------------
 .../tomee/catalina/TomcatWebAppBuilder.java     | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/a3150bb3/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
index 9a05ce3..0ba0c30 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
@@ -1130,6 +1130,10 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener, Pare
             return;
         }
 
+        if (shouldNotDeploy(standardContext)) {
+            return;
+        }
+
         final CoreContainerSystem cs = getContainerSystem();
 
         final Assembler a = getAssembler();
@@ -1422,6 +1426,23 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener, Pare
         realms.put(standardContext.getName(), realm);
     }
 
+    private static boolean shouldNotDeploy(StandardContext standardContext) {
+        if (StandardHost.class.isInstance(standardContext.getParent())) {
+            final StandardHost host = StandardHost.class.cast(standardContext.getParent());
+            if (host.getAutoDeploy() && new File(host.getAppBaseFile(), standardContext.getPath()).isDirectory() && (
+                    new File(host.getAppBaseFile(), standardContext.getPath() + ".ear").exists() ||
+                    new File(host.getAppBaseFile(), standardContext.getPath() + ".rar").exists())
+            ) {
+
+                logger.info(String.format("Not deploying exploded directory %s as Java EE artifact exists which will be deployed.",
+                        new File(host.getAppBaseFile(), standardContext.getPath()).getAbsolutePath()));
+
+                return true;
+            }
+        }
+        return false;
+    }
+
     private static File rootPath(final File file) {
         if (file.isDirectory() && file.getName().equals("classes") && file.getParentFile() != null && file.getParentFile().getName().equals("WEB-INF")) {
             return file.getParentFile().getParentFile();
@@ -1572,6 +1593,10 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener, Pare
             return;
         }
 
+        if (shouldNotDeploy(standardContext)) {
+            return;
+        }
+
         final Realm realm = standardContext.getRealm();
         final ClassLoader classLoader = standardContext.getLoader().getClassLoader();
         final Thread thread = Thread.currentThread();


[2/2] tomee git commit: TOMEE-2145 fix compile error

Posted by jg...@apache.org.
TOMEE-2145 fix compile error


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4b11c31b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4b11c31b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4b11c31b

Branch: refs/heads/tomee-1.7.x
Commit: 4b11c31b714e8093ae18d5638a5c0b07cb2e7097
Parents: a3150bb
Author: Jonathan Gallimore <jo...@jrg.me.uk>
Authored: Wed Nov 1 17:24:39 2017 +0000
Committer: Jonathan Gallimore <jo...@jrg.me.uk>
Committed: Wed Nov 1 17:24:39 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/tomee/catalina/TomcatWebAppBuilder.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/4b11c31b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
index 0ba0c30..647cc5b 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
@@ -1429,13 +1429,13 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener, Pare
     private static boolean shouldNotDeploy(StandardContext standardContext) {
         if (StandardHost.class.isInstance(standardContext.getParent())) {
             final StandardHost host = StandardHost.class.cast(standardContext.getParent());
-            if (host.getAutoDeploy() && new File(host.getAppBaseFile(), standardContext.getPath()).isDirectory() && (
-                    new File(host.getAppBaseFile(), standardContext.getPath() + ".ear").exists() ||
-                    new File(host.getAppBaseFile(), standardContext.getPath() + ".rar").exists())
+            if (host.getAutoDeploy() && new File(host.getAppBase(), standardContext.getPath()).isDirectory() && (
+                    new File(host.getAppBase(), standardContext.getPath() + ".ear").exists() ||
+                    new File(host.getAppBase(), standardContext.getPath() + ".rar").exists())
             ) {
 
                 logger.info(String.format("Not deploying exploded directory %s as Java EE artifact exists which will be deployed.",
-                        new File(host.getAppBaseFile(), standardContext.getPath()).getAbsolutePath()));
+                        new File(host.getAppBase(), standardContext.getPath()).getAbsolutePath()));
 
                 return true;
             }