Skip to content
Advertisement

Redisson for JCache Session persistence on WebSphere-Liberty: how to pass redisson-jcache.yaml?

Hello Open Liberty experts,

As an R&D effort, I am trying to enable Liberty session persistence backed by Redis via JCache/Redisson. I observe the CLASSPATH seems to be correctly configured via <library> and <httpSessionCache libraryRef> syntax, but the config file is not being passed to org.redisson.jcache.JCacheManager.createCache(). This method is an implementation of javax.cache.CacheManager.createCache()

Here is my server.xml:

JavaScript

Regardless of what value I set as uri="file:${shared.resource.dir}/redisson-jcache.yaml" I still get this exception at startup time for Liberty.

JavaScript

I tried setting a completely bogus value for uri="file:${shared.resource.dir}/redisson-jcache.yaml" and I still get the same result: IllegalStateException as shown above. What am I missing?

Thanks,

Ed

Advertisement

Answer

Sadly solution to this problem is fairly simple, working out the problem was more complicated. There was a typo in the redisson-jcache.yaml file. Since I know Ed we have been talking off stack overflow and we discovered the redisson-jcache.yaml file contained this:

JavaScript

it turns out that it should have been:

JavaScript

note the correct form has server as plural.

So what went wrong, it turns out that if the reddison yaml file doesn’t parse for any reason it proceeds as if no configuration was provided with no error message to indicate what the problem processing the configuration was. It then throws a cryptic exception saying no configuration was provided.

Inserting a printStackTrace call into the right place in the Redisson code base resulted in a useful error message that said:

JavaScript

So the conclusion here is to make absolutely sure your redisson yaml is correct. Having fixed that everything worked.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement