question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClassLoader issues when using Redisson Transactions with asynchronously acquired RedissonClient

See original GitHub issue

Expected behavior When using an asynchronously acquired RedissonClient (via. CompletableFuture.supplyAsync) with transactions I expect the class loader used to be correct.

Some constraints to narrow the scope of the problem:

  • I only encountered this when using Redisson Transactions.
  • If the client was acquired in a synchronous way, I did not see this behavior.

Actual behavior Similar to #2984 I am seeing that on the first request to my WAR on a web server, the correct class loader is used. Screen Shot 2021-03-17 at 10 55 06 AM

But then on subsequent requests, it is using the URLClassPath loader what I assume to be the default for Jetty. Screen Shot 2021-03-17 at 10 59 04 AM

After this breaks, I get consistent ClassNotFound errors.

Steps to reproduce or test case I created a minimal jetty project here in an effort to reproduce the code we are running.

In words, my steps were as follows: Create a Jetty Server running 9.4.30.v20200611, and deploy a WAR on it. Place objects into Redis, using transactions, and try to retrieve them. After the first request succeeds, observe ClassNotFound issues when trying to retrieve other objects. The stack trace can be found in a gist.

Redis version 6.0.5

Redisson version 13.15.1

Redisson configuration

    redissonConfig
        .useSingleServer()
        .setConnectTimeout(10_000)
        .setTimeout(10_000)
        .setRetryAttempts(0)
        .setConnectionPoolSize(20)
        .setConnectionMinimumIdleSize(1)
        .setPassword("SECRET")
        .setAddress("redis://host.docker.internal:6379");

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nab0310commented, Mar 31, 2021

That fixed it! Thanks!

0reactions
mrnikocommented, Mar 25, 2021

set useThreadClassLoader = false in configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing classloader problems with Spring Devtools ... - Life in IDE
Embedded Redisson Node is a service where you can execute asynchronous tasks using Redis with Redisson. This library is not bound to Spring ......
Read more >
Index (Redisson 3.8.1 API) - Javadoc.io
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted. acquire() - Method in interface org.redisson.api.
Read more >
Java Agent version 1.x | APM Java Agent Reference [master]
Changed the main agent class loader to work in a child-first delegation model, ... asynchronous handling of requests for which the corresponding transaction...
Read more >
Redisson client ; RedisTimeoutException issue - Stack Overflow
Assuming you are getting low memory alerts on your cache JVM. You may have to analyze the traffic and determine 2 things.
Read more >
目录
transaction obtained from JTA compatible transaction manager ... Redisson uses high-perfomance async and lock-free Redis client for Java.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found