On 07/05/2020 21:36, Jonathan Yom-Tov wrote:
> My application uses Redisson (a client which persists the session to
> Redis). There are two Redisson jar files located in $CATALINA_HOME/lib, so
> if I understand the docs correctly they're loaded by the common class
> loader.
> 
> I want to access the RedissonSessionManager class during a request. The
> problem is that if I do something like RedissonSessionManager manager =
> (RedissonSessionManager) session.getManager() I get a ClassCastException,
> presumably because they were loaded by different class loaders.
> 
> Will it help if I somehow access the common class loader for this? If so
> how can I do that? If not is there some other way I can achieve this?

Make sure you don't have those JARs in your application's WEB-INF/lib as
well as $CATALINA_BASE/lib.

In any recent version of Tomcat any JAR in $CATALINA_BASE/lib will be
visible to your application.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to