Bug 49965 - JAASRealm uses wrong string constants
JAASRealm uses wrong string constants
Product: Tomcat 6
Classification: Unclassified
Component: Catalina
PC Linux
: P2 minor (vote)
: default
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2010-09-20 21:03 UTC by Jyri Virkki
Modified: 2010-10-28 20:15 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Jyri Virkki 2010-09-20 21:03:26 UTC
org.apache.catalina.realm.JAASRealm imports:

import org.apache.catalina.authenticator.Constants;

This means that the StringManager it creates:

    protected static final StringManager sm =

ends up getting the message strings from org.apache.catalina.authenticator.LocalStrings.properties instead of the one from its own package.

As a result whenever the JAASRealm code attempts to look up message strings, they won't be found. For example, when authentication fails, line 430:

            log.warn(sm.getString("jaasRealm.loginException", username), e);

Since org.apache.catalina.authenticator.LocalStrings.properties does not have a "jaasRealm.loginException" entry, what shows up in the logs is

WARNING: Cannot find message associated with key jaasRealm.loginException

This is based on running and looking at 6.0.29 code, but I remember seeing the same behavior in 6.0.20 as well.
Comment 1 Mark Thomas 2010-10-06 19:08:09 UTC
This was already fixed in trunk/7.0.x

I have proposed a back-port of the fix for 6.0.x
Comment 2 Konstantin Kolinko 2010-10-28 20:15:47 UTC
Fixed in 6.0 by r1028559, will be in 6.0.30.