Workaround for Tomcat 9.0.46 (bug 65308) - NPE in JNDIRealm
Since you already did the heavy-lifting of finding a patch, the easiest "workaround" is to patch the class affected by the bug.
You just need to:
- Download the patched
JNDIRealm.java
file, - Compile it against your Tomcat's jars:
javac -cp '/path/to/tomcat/lib/*:/path/to/tomcat/bin/*' JNDIRealm.java
- Put the generated class files in
$CATALINA_BASE/lib/org/apache/catalina/realm
. Due to the way the common loader is configured, the class files will override the corresponding classes in thecatalina.jar
.