Skip to content

Commit

Permalink
Fix session manager classloader
Browse files Browse the repository at this point in the history
  • Loading branch information
spbolton committed Aug 23, 2024
1 parent ba4ecf5 commit 07226c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dotCMS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<tomcat-dist-folder>dotserver/tomcat-${tomcat.version}</tomcat-dist-folder>
<tomcat-lib-folder>${assembly-directory}/${tomcat-dist-folder}/lib</tomcat-lib-folder>
<tomcat-log4j-lib-folder>${assembly-directory}/${tomcat-dist-folder}/log4j2/lib</tomcat-log4j-lib-folder>
<session-manager-lib-folder>${assembly-directory}/${tomcat-dist-folder}/session-manager/lib</session-manager-lib-folder>
<session-manager-lib-folder>${tomcat-lib-folder}</session-manager-lib-folder>
<tomcat9-overrides>${project.basedir}/src/main/resources/container/tomcat9</tomcat9-overrides>
<exploded-webapp-dir>${assembly-directory}/${tomcat-dist-folder}/webapps/ROOT</exploded-webapp-dir>
<war.output.file>${project.build.directory}/${project.build.finalName}-war.war</war.output.file>
Expand Down
6 changes: 3 additions & 3 deletions dotCMS/src/main/resources/container/tomcat9/bin/setenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions dotCMS/src/main/resources/container/tomcat9/bin/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 07226c8

Please sign in to comment.