File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Unable to find LoginModule class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to find LoginModule class" Watch "Unable to find LoginModule class" New topic
Author

Unable to find LoginModule class

Michel de Jong
Greenhorn

Joined: Apr 25, 2005
Posts: 2

Hi Java Guru's,

I am using a Java application compiled with version 1.4.2_05 running on Tomcat 5.0.28. I need to move this application to a new server running OpenJDK 1.6.0_20 and Tomcat 5.5.23. I unfortunately do not have the source :-(
The application uses a custom login module to authenticate via a Radius server.

So I have deployed the WAR on the new server, created a jaas.conf and added ' -Djava.security.auth.login.config==$CATALINA_HOME/conf/jaas.conf' to the Tomcat configuration file. However I keep getting this error.
javax.security.auth.login.LoginException: unable to find LoginModule class: jaas.RadiusLoginModule

The class 'RadiusLoginModule' is present in the application in the directory jaas. So Tomcat should be able to find the class right? I am probably doing something wrong. But I cannot see what. I added my jaas.conf and context.xml.

jaas.conf

JRadiusClientLoginModule {
jaas.RadiusLoginModule required
};

META-INF/context.xml

<Context path="/application" reloadable="true" debug="0" privileged="true">
<Realm className="org.apache.catalina.realm.JAASRealm"
debug="99"
appName="JRadiusClientLoginModule"
userClassNames="jaas.RadiusPrincipal"
roleClassNames="jaas.RolePrincipal">
</Realm>
</Context>


If more information is required please let me know. I hope somebody can point me in the right direction ;-)

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

Welcome to the JavaRanch, Michel!

If your app requires Tomcat 5 and Java 1.4 and you have no source code, your worries are just beginning. Both of the preceeding are obsolete and Java 1.4 is beyond End-of-Life.

Tomcat's security Realms operate as part of the Tomcat server and not as part of the webapp. So having the Radius class in the WAR won't help any - it won't be in Tomcat's personal classpath.

You can copy this class out to the tomcat server lib directory, but something is amiss if the app ever expected things to work as things are so I can't guarantee results.


Customer surveys are for companies who didn't pay proper attention to begin with.
Michel de Jong
Greenhorn

Joined: Apr 25, 2005
Posts: 2

Hey Tim,

Thank you so much for the quick reply. Regarding moving from Java 1.4, I was already afraid you where going to say that...

I will try putting the class in the lib directory and let you know how this worked out.

With kind regards,

Michel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to find LoginModule class
 
Similar Threads
Jaas + Tomcat 6 + Multiple modules
Error in integrating Simple JAAS with Tomcat 5.0
Tomcat BASIC authentication fails in certain cases
Tomcat issue with custom JAASLogin module
Weblogic 8.1 / JAAS Authentication