Search code examples
javatomcattomcat7jaas

Why is tomcat7 unable to find LoginModule class in JAAS


I have an application packaged in a WAR which is running great on an existing Tomcat6 server.

I am now trying to deploy it in tomcat7 but am getting the following error as soon as I run the login action: Failed login. Reason: LoginException: unable to find LoginModule class: security.jass.SimpleLoginModule

I have the contents below in the conf file, which is defined in Java's security.properties:

UserLoginImpo
{
security.jass.SimpleLoginModule required;
};

Changing the class name here (to a wrong one) will make tomcat say it can't find that one, which eliminates the cause "the conf file isn't being picked up".

The class should be in the classpath: it's inside a jar in the lib folder of the WAR.

What could I be missing?


Solution

  • As @Jim pointed out, the package name was not correct: security.jaas, not security.jass.

    Goes to prove you really need to pay attention to details.