You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by br...@apache.org on 2021/04/09 23:28:11 UTC

[geode] 05/12: GEODE-7896 Update tomcat support

This is an automated email from the ASF dual-hosted git repository.

bross pushed a commit to branch support/1.12
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 1d682fe2002cae4bd37077bf935c8d14de8b9fe0
Author: Anthony Baker <ab...@apache.org>
AuthorDate: Wed May 13 12:04:43 2020 -0700

    GEODE-7896 Update tomcat support
    
    Update tomcat integration to work with versions after 9.0.21.
    
    (cherry picked from commit 70fe060bbdba951512403cc0795f29bd2d7d21d6)
---
 .../gradle/plugins/DependencyConstraints.groovy    |  2 +-
 .../modules/session/catalina/DeltaSession.java     | 24 +++++++++++++++++++++-
 .../apache/geode/session/tests/TomcatInstall.java  |  2 +-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
index c6758c5..c5c9d42 100644
--- a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
+++ b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
@@ -53,7 +53,7 @@ class DependencyConstraints implements Plugin<Project> {
     deps.put("tomcat6.version", "6.0.37")
     deps.put("tomcat7.version", "7.0.96")
     deps.put("tomcat8.version", "8.5.46")
-    deps.put("tomcat9.version", "9.0.12")
+    deps.put("tomcat9.version", "9.0.33")
 
     // The jetty version is also hard-coded in geode-assembly:test
     // at o.a.g.sessions.tests.GenericAppServerInstall.java
diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession.java
index aa8b3f5..4e5e969 100644
--- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession.java
+++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession.java
@@ -366,7 +366,29 @@ public class DeltaSession extends StandardSession
 
   @Override
   public void localUpdateAttribute(String name, Object value) {
-    super.setAttribute(name, value, false); // don't do notification since this is a replication
+    if (this.manager == null) {
+      // Name cannot be null
+      if (name == null) {
+        throw new IllegalArgumentException(sm.getString("standardSession.setAttribute.namenull"));
+      }
+
+      // Null value is the same as removeAttribute()
+      if (value == null) {
+        removeAttribute(name);
+        return;
+      }
+
+      // Validate our current state
+      if (!isValidInternal()) {
+        throw new IllegalStateException(
+            sm.getString("standardSession.setAttribute.ise", getIdInternal()));
+      }
+
+      // Replace or add this attribute
+      getAttributes().put(name, value);
+    } else {
+      super.setAttribute(name, value, false); // don't do notification since this is a replication
+    }
   }
 
   @Override
diff --git a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/TomcatInstall.java b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/TomcatInstall.java
index a7da1ff..572fa20 100644
--- a/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/TomcatInstall.java
+++ b/geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/TomcatInstall.java
@@ -43,7 +43,7 @@ public class TomcatInstall extends ContainerInstall {
     TOMCAT6(6, "tomcat-6.0.37.zip"),
     TOMCAT7(7, "tomcat-7.0.96.zip"),
     TOMCAT8(8, "tomcat-8.5.46.zip"),
-    TOMCAT9(9, "tomcat-9.0.12.zip");
+    TOMCAT9(9, "tomcat-9.0.33.zip");
 
     private final int version;