Bug 49965 - JAASRealm uses wrong string constants
Summary: JAASRealm uses wrong string constants
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.29
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 21:03 UTC by Jyri Virkki
Modified: 2010-10-28 20:15 UTC (History)
0 users



Attachments

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 =
        StringManager.getManager(Constants.Package);

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.