0
votes

I have a custom realm in tomcat6 which is deployed and using jars in the tomcat/lib directory. I would like to move those jars out of tomcat/lib into their separate shared folder of some sort, as I think they may be conflicting with the jars of a WAR.

I tried setting shared.loader to ${catalina.base}/shared/lib,${catalina.base}/shared/lib/*.jar

However, the realm fails to find the jars. Since I don't know the logic for Realm classpaths I tried setting server.loader to also point to my shared lib, but that didn't help any. I'm not sure if I have something wrong with the shared lib, or if the Realm's classpath is resolved in a different manner and so ignores these arguments?

1
Where are the Realm classes? Where are the dependent classes? What error do you get? Why can't you put everything into ${catalina.base}/lib?Christopher Schultz

1 Answers

0
votes

Tomcat's shared ClassLoader is not what you want: that one is for sharing libraries across web applications. Instead, you want the server ClassLoader. Note that the server ClassLoader's default setting is that of the common ClassLoader, so you'll need to copy the existing setting from common.loader into server.loader and then add your own JAR file to it.

Honestly, if you have a custom realm that is conflicting with one of your web applications, you should probably just fix the web application and/or the Realm.