This is an automated email from the ASF dual-hosted git repository. bschuchardt pushed a commit to branch feature/GEODE-7168 in repository https://gitbox.apache.org/repos/asf/geode.git
commit 2e93d32ccdabff1f353f00d7481f2ff11e6c0004 Author: Bruce Schuchardt <bschucha...@pivotal.io> AuthorDate: Fri Sep 6 14:59:21 2019 -0700 Revert "Revert "GEODE-6867: Updating Tomcat Session State Module docs (#3886)"" This reverts commit c058bb2b02e037ebc747b5a2909a31afb0ef153c. --- .../apache/geode/session/tests/TomcatInstall.java | 6 ++ .../Tomcat8ClientServerRollingUpgradeTest.java | 81 ++++++++++++++++++++-- .../tomcat_installing_the_module.html.md.erb | 3 + .../tomcat_setting_up_the_module.html.md.erb | 17 +++-- .../weblogic_setting_up_the_module.html.md.erb | 7 ++ 5 files changed, 100 insertions(+), 14 deletions(-) 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 dabf7df..e1aa0bf 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 @@ -89,6 +89,12 @@ public class TomcatInstall extends ContainerInstall { } } + /** + * If you update this list method to return different dependencies, please also update + * the Tomcat module documentation! + * The documentation can be found here: + * geode-docs/tools_modules/http_session_mgmt/tomcat_installing_the_module.html.md.erb + */ private static final String[] tomcatRequiredJars = {"antlr", "commons-io", "commons-lang", "commons-validator", "fastutil", "geode-common", "geode-core", "geode-management", "javax.transaction-api", "jgroups", "log4j-api", diff --git a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java index e00d4cc..943bb89 100644 --- a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java +++ b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/Tomcat8ClientServerRollingUpgradeTest.java @@ -20,7 +20,9 @@ import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Collection; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.commons.lang3.JavaVersion; import org.apache.commons.lang3.SystemUtils; @@ -36,6 +38,7 @@ import org.junit.runners.Parameterized; import org.apache.geode.cache.RegionShortcut; import org.apache.geode.internal.UniquePortSupplier; +import org.apache.geode.internal.Version; import org.apache.geode.management.internal.cli.i18n.CliStrings; import org.apache.geode.management.internal.cli.util.CommandStringBuilder; import org.apache.geode.test.junit.categories.BackwardCompatibilityTest; @@ -57,12 +60,20 @@ public class Tomcat8ClientServerRollingUpgradeTest { private String locatorDir; private String server1Dir; private String server2Dir; + private static Map<String, Version> versionMap = new HashMap<>(); @Parameterized.Parameters(name = "{0}") public static Collection<String> data() { List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent(); int minimumVersion = SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9) ? 180 : 170; result.removeIf(s -> Integer.parseInt(s) < minimumVersion); + Version.getAllVersions().forEach(v -> { + result.forEach(r -> { + if (r.equals(v.getName().replace(".", ""))) { + versionMap.put(r, v); + } + }); + }); return result; } @@ -140,12 +151,9 @@ public class Tomcat8ClientServerRollingUpgradeTest { ContainerInstall.ConnectionType.CLIENT_SERVER, portSupplier::getAvailablePort); - classPathTomcat8AndOldModules = tomcat8AndOldModules.getHome() + "/lib/*" + File.pathSeparator - + tomcat8AndOldModules.getHome() + "/bin/*"; + classPathTomcat8AndOldModules = getClassPathTomcat8AndOldModules(); - classPathTomcat8AndCurrentModules = - tomcat8AndCurrentModules.getHome() + "/lib/*" + File.pathSeparator - + tomcat8AndCurrentModules.getHome() + "/bin/*"; + classPathTomcat8AndCurrentModules = getClassPathTomcat8AndCurrentModules(); // Get available port for the locator locatorPort = portSupplier.getAvailablePort(); @@ -290,4 +298,67 @@ public class Tomcat8ClientServerRollingUpgradeTest { } } + /** + * If this test breaks due to a change in required jars, please update the + * "Setting up the Module" section of the Tomcat module documentation! + * + * Returns the jars required on the classpath for the old modules. This list may + * differ from the list required by the current modules at some point in the future, hence the + * duplication of the requiredClasspathJars array. + * + * @return Paths to required jars + */ + private String getClassPathTomcat8AndOldModules() { + String oldVersion = versionMap.get(this.oldVersion).getName(); + + final String[] requiredClasspathJars = { + "/lib/geode-modules-" + oldVersion + ".jar", + "/lib/geode-modules-tomcat8-" + oldVersion + ".jar", + "/lib/servlet-api.jar", + "/lib/catalina.jar", + "/lib/tomcat-util.jar", + "/bin/tomcat-juli.jar" + }; + + return getRequiredClasspathJars(tomcat8AndOldModules.getHome(), requiredClasspathJars); + } + + /** + * If this test breaks due to a change in required jars, please update the + * "Setting up the Module" section of the Tomcat module documentation! + * + * Returns the jars required on the classpath for the current modules. This list may + * differ from the list required by the old modules at some point in the future, hence the + * duplication of the requiredClasspathJars array. + * + * @return Paths to required jars + */ + private String getClassPathTomcat8AndCurrentModules() { + String currentVersion = Version.CURRENT.getName(); + + final String[] requiredClasspathJars = { + "/lib/geode-modules-" + currentVersion + "-SNAPSHOT.jar", + "/lib/geode-modules-tomcat8-" + currentVersion + "-SNAPSHOT.jar", + "/lib/servlet-api.jar", + "/lib/catalina.jar", + "/lib/tomcat-util.jar", + "/bin/tomcat-juli.jar" + }; + + return getRequiredClasspathJars(tomcat8AndCurrentModules.getHome(), requiredClasspathJars); + } + + private String getRequiredClasspathJars(final String tomcat8AndRequiredModules, + final String[] requiredClasspathJars) { + StringBuilder completeJarList = new StringBuilder(); + for (String requiredJar : requiredClasspathJars) { + completeJarList.append(tomcat8AndRequiredModules) + .append(requiredJar) + .append(File.pathSeparator); + } + + completeJarList.deleteCharAt(completeJarList.length() - 1); + + return completeJarList.toString(); + } } diff --git a/geode-docs/tools_modules/http_session_mgmt/tomcat_installing_the_module.html.md.erb b/geode-docs/tools_modules/http_session_mgmt/tomcat_installing_the_module.html.md.erb index 45b4a56..6c633f2 100644 --- a/geode-docs/tools_modules/http_session_mgmt/tomcat_installing_the_module.html.md.erb +++ b/geode-docs/tools_modules/http_session_mgmt/tomcat_installing_the_module.html.md.erb @@ -31,12 +31,15 @@ This topic describes how to install the HTTP session management module for Tomca - commons-lang jar - commons-validator jar - fastutil jar + - geode-commons jar - geode-core jar + - geode-management jar - javax.transaction-api jar - jgroups jar - log4j-api jar - log4j-core jar - log4j-jul jar + - micrometer-core jar - shiro-core jar diff --git a/geode-docs/tools_modules/http_session_mgmt/tomcat_setting_up_the_module.html.md.erb b/geode-docs/tools_modules/http_session_mgmt/tomcat_setting_up_the_module.html.md.erb index c57eb49..8a6b217 100644 --- a/geode-docs/tools_modules/http_session_mgmt/tomcat_setting_up_the_module.html.md.erb +++ b/geode-docs/tools_modules/http_session_mgmt/tomcat_setting_up_the_module.html.md.erb @@ -107,19 +107,18 @@ For Tomcat 9.0: The application server operates as a <%=vars.product_name%> client in this configuration. With a similar environment to this example that is for a client/server set up, ``` pre -TC_VER=tomcat-8.0.30.C.RELEASE -INSTANCE=geode-cs -CLASSPATH=$PWD/$INSTANCE/lib/geode-modules-1.0.0.jar:\ -$PWD/$INSTANCE/lib/geode-modules-tomcat8-1.0.0.jar:\ -$PWD/$TC_VER/lib/servlet-api.jar:\ -$PWD/$TC_VER/lib/catalina.jar:\ -$PWD/$TC_VER/lib/tomcat-util.jar:\ -$PWD/$TC_VER/bin/tomcat-juli.jar +CLASSPATH=$PWD/lib/geode-modules-<%=vars.product_version%>.0.jar:\ +$PWD/lib/geode-modules-tomcat8-<%=vars.product_version%>.0.jar:\ +$PWD/lib/servlet-api.jar:\ +$PWD/lib/catalina.jar:\ +$PWD/lib/tomcat-util.jar:\ +$PWD/bin/tomcat-juli.jar ``` -Start the server using `gfsh`: +Start the locator and server using `gfsh`: ``` pre +$ gfsh start locator --name=locator1 --classpath=$CLASSPATH $ gfsh start server --name=server1 --locators=localhost[10334] --server-port=0 \ --classpath=$CLASSPATH ``` diff --git a/geode-docs/tools_modules/http_session_mgmt/weblogic_setting_up_the_module.html.md.erb b/geode-docs/tools_modules/http_session_mgmt/weblogic_setting_up_the_module.html.md.erb index c205555..10db529 100644 --- a/geode-docs/tools_modules/http_session_mgmt/weblogic_setting_up_the_module.html.md.erb +++ b/geode-docs/tools_modules/http_session_mgmt/weblogic_setting_up_the_module.html.md.erb @@ -62,14 +62,21 @@ To modify your war or ear file manually, make the following updates: - slf4j-jdk14 jar - Add the following jar files from the `$GEODE/lib` directory to the `WEB-INF/lib` directory of the war, where `$GEODE` is set to the <%=vars.product_name%> product installation: - antlr jar + - commons-io jar + - commons-lang jar + - commons-validator jar - fastutil jar + - geode-commons jar - geode-core jar - geode-json jar + - geode-management jar - javax.transaction-api jar - jgroups jar - log4j-api jar - log4j-core jar - log4j-jul jar + - micrometer-core jar + - shiro-core jar If you are deploying an ear file: