diff --git a/dotCMS/pom.xml b/dotCMS/pom.xml
index f7fa0c97edfd..bc5557037e7f 100644
--- a/dotCMS/pom.xml
+++ b/dotCMS/pom.xml
@@ -26,7 +26,7 @@
dotserver/tomcat-${tomcat.version}
${assembly-directory}/${tomcat-dist-folder}/lib
${assembly-directory}/${tomcat-dist-folder}/log4j2/lib
- ${assembly-directory}/${tomcat-dist-folder}/session-manager/lib
+ ${tomcat-lib-folder}
${project.basedir}/src/main/resources/container/tomcat9
${assembly-directory}/${tomcat-dist-folder}/webapps/ROOT
${project.build.directory}/${project.build.finalName}-war.war
diff --git a/dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat b/dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat
index 907b1ad54e3d..3eb097ec102f 100644
--- a/dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat
+++ b/dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat
@@ -33,8 +33,8 @@ set "CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.tomcat.util.digester.PROPERTY_SO
rem Check if log4j2.configurationFile is already set
echo %CATALINA_OPTS% | findstr /C:"-Dlog4j2.configurationFile" >nul
if %errorlevel% neq 0 (
- echo Setting log4j2.configurationFile=%TOMCAT_HOME%\webapps\ROOT\WEB-INF\log4j\log4j2.xml
- set "CATALINA_OPTS=%CATALINA_OPTS% -Dlog4j2.configurationFile=%TOMCAT_HOME%\webapps\ROOT\WEB-INF\log4j\log4j2.xml"
+ echo Setting log4j2.configurationFile=%CATALINA_HOME%\webapps\ROOT\WEB-INF\log4j\log4j2.xml
+ set "CATALINA_OPTS=%CATALINA_OPTS% -Dlog4j2.configurationFile=%CATALINA_HOME%\webapps\ROOT\WEB-INF\log4j\log4j2.xml"
) else (
echo Log4j configuration already set
)
@@ -49,7 +49,7 @@ if %errorlevel% neq 0 (
)
rem Set the CLASSPATH
-set "ADDITIONAL_CLASSPATH=%CATALINA_HOME%\log4j2\lib\*;%CATALINA_HOME%\session-manager\lib\*"
+set "ADDITIONAL_CLASSPATH=%CATALINA_HOME%\log4j2\lib\*"
if "%CLASSPATH%" neq "" (
set "CLASSPATH=%CLASSPATH%;%ADDITIONAL_CLASSPATH%"
) else (
diff --git a/dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh b/dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh
index 1d6d02d4ad80..08cdacb27f73 100644
--- a/dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh
+++ b/dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh
@@ -34,8 +34,8 @@ export CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.tomcat.util.digester.PROPERTY_
if echo "$CATALINA_OPTS" | grep -q '\-Dlog4j2\.configurationFile'; then
echo "Log4j configuration already set"
else
- echo "Setting log4j2.configurationFile=$TOMCAT_HOME/webapps/ROOT/WEB-INF/log4j/log4j2.xml"
- export CATALINA_OPTS="$CATALINA_OPTS -Dlog4j2.configurationFile=$TOMCAT_HOME/webapps/ROOT/WEB-INF/log4j/log4j2.xml"
+ echo "Setting log4j2.configurationFile=$CATALINA_HOME/webapps/ROOT/WEB-INF/log4j/log4j2.xml"
+ export CATALINA_OPTS="$CATALINA_OPTS -Dlog4j2.configurationFile=$CATALINA_HOME/webapps/ROOT/WEB-INF/log4j/log4j2.xml"
fi
if echo "$CATALINA_OPTS" | grep -q '\-DLog4jContextSelector'; then
@@ -45,7 +45,7 @@ else
export CATALINA_OPTS="$CATALINA_OPTS -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector"
fi
-ADDITIONAL_CLASSPATH="$CATALINA_HOME/log4j2/lib/*:$CATALINA_HOME/session-manager/lib/*"
+ADDITIONAL_CLASSPATH="$CATALINA_HOME/log4j2/lib/*"
if [ -n "$CLASSPATH" ]; then
CLASSPATH="$CLASSPATH:$ADDITIONAL_CLASSPATH"