Bug 49965

Summary: JAASRealm uses wrong string constants
Product: Tomcat 6 Reporter: Jyri Virkki <jyri>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 6.0.29   
Target Milestone: default   
Hardware: PC   
OS: Linux   

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.