tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miller, Steve" <>
Subject JAAS and TOMCAT 5
Date Fri, 13 Feb 2004 20:16:00 GMT

I have finally pulled the last hair out of my head on this one. I'm running
Tomcat 5 on my Windows2000 desktop (for development purposes) and trying to
get JAAS to successfully integrate with it. I have successfully run the
examples from Sun's site for the JAAS tutorial and just trying to get it to
work on Tomcat now. I'm still a bit of a newbie to JAAS, so I'm not sure if
I'm doing something wrong there or just not setting up Tomcat and/or my
windows environment correctly...which I think is the real problem here. I
have exhausted all of my research on the internet and I couldn't find
anything out there regarding JAAS and Tomcat I thought I'd try here.

Here is the error I am getting from Tomcat: Unable to locate a login configuration

I'm assuming from this message that Tomcat cannot find the JAAS
configuration file. I have it stored as "%CATALINA_HOME%/conf/jaas.conf".
It's code is as follows:
MeritPool {
    JAAS.MyLoginModule required;

I have put my compiled classes for my LoginModule, UserPrincipal, and
RolePrincipal under "%CATALINA_HOME%/server/classes/JAAS" as well as

In the file under %JAVA_HOME%/jre/lib/security, I included

I have set the JAVA_OPTS environement variable in both my windows
environment,, and catalina.bat files to:

(in catalina.bat) set
(in windows env. variable)

In the above lines, I tried it with on "=" as well.

I am using the Tomcat security configuration to "protect" one of my contexts
and to route to a login page. The login page form is submitted to
"j_security_check" with the code as follows:

<form method="GET" action='<%= response.encodeURL("j_security_check") %>' >
  <table border="0" cellspacing="5">
      <th align="right">Username:</th>
      <td align="left"><input type="text" name="j_username"></td>
      <th align="right">Password:</th>
      <td align="left"><input type="password" name="j_password"></td>
      <td align="right"><input type="submit" value="Log In"></td>
      <td align="left"><input type="reset"></td>

This login page works fine using MemoryRealm and authenticates beautifully.
But, when I comment that out in my server.xml file and instead use the
JAASRealm, using the login page doesn't work and Tomcat displays the error
that the login configuration cannot be located. My JAASRealm definition is:

<Realm className="org.apache.catalina.realm.JAASRealm" debug="3"
appName="MeritPool" userClassNames="JAAS.MyPrincipal"
roleClassNames="JAAS.MyRolePrincipal" />

Can somebody here hopefully help me replace some of my lost hair? :-)  I'm
on digest mode, so bear with me if I am delayed in responding.

Thanks in advance!
Steve Miller

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message