Hello beautiful people,
Recently while helping a client troubleshoot their 11.2 to 13.2 upgrade, I discovered that the CMS Updater Editor was not loading on their hosted environments (ie, Dev), but it did work locally. When I checked the logs, I found this was due to a NoClassDefFoundError
for org.slf4j.event.Level
. I interpreted this as a sign that a dependency was missing, so I decided to check the libs added to Tomcat, since the libs included in the project wars would be consistent across all environments.
I made a list of all jars in my local tomcat9x (cargo.run) common/libs and shared/libs folders, and compared it to the list of jars in Tomcat’s libs folder on the Dev environment. I found 11 jars on my local environment which were missing on the client’s Dev environment:
< hippo-cms7-commons-13.2.0.jar
< hippo-repository-api-13.2.0.jar
< hippo-repository-builtin-13.2.0.jar
< hippo-services-13.2.0.jar
< hippo-services-autoreload-13.2.0.jar
< hst-api-13.2.0.jar
< jcl-over-slf4j-1.7.25.jar
< log4j-api-2.11.1.jar
< log4j-core-2.11.1.jar
< log4j-slf4j-impl-2.11.1.jar
< slf4j-api-1.7.25.jar
The missing autoreload
jar makes sense, since that was unwanted on prod-like environments. I was, however, surprised by the other missing hippo-*
jars, as well as the missing logging jars. Not unsurprisingly, the culprit behind the NoClassDefFoundError
was the missing slf4j-api-1.7.25.jar
. Upon copying this jar to the Dev environment and restarting Tomcat, the Updater Editor worked as expected. Unfortunately, adding that jar also broke brXM logging. The hippo-* logs only had a small number of items appended after that jar was added to the Tomcat libs folder.
So this leads me to two questions (or groups of questions, as it may be):
-
Why might the logging have broken when the SLF4J jar was added to Tomcat? Perhaps that jar was already contributed from somewhere else, with a log4j/slf4j configuration relative to the pre-existing jar. But if this is the case, why was slf4j’s Error class not found by the CMS application, and why was the logging on the Dev environment seemingly the same as my local environment (which definitely had the SLF4J jar)?
-
Why are these 11 jars added to Tomcat directly (locally, this is part of the
cargo.run
profile configured in hippo-cms7-project), instead of included in the assembled war files for the applicable brXM webapps? I suspect that there is a need to share these jars across the multiple applications, or perhaps embedding these libs in multiple webapps (ie, cms and site) in the same container would cause conflicts? In any case, thecargo.run
maven profile is not typically used to run brXM on non-local environments, so where can I find the necessary brXM documentation which specifies the necessary logging jars for a non-local environment?
Thanks in advance!
Dave