spring-projects/spring-data-mongodb

Blinker NoClassDefFoundError: com/mongodb/internal/binding/ReferenceCounted

Closed this issue · 1 comments

Context:
We have scheduled services (jobs) that run multiple times a day. However, there is an issue where 1-3 runs per day fail with an error. All other runs are problem-free. Therefore, the error seems blinked.

Environment:

  1. We run these services using an docker image on Kubernetes.
  2. We connect to AWS DocumentDB.

Versions:
I think the main dependencies are Spring and related MongoDB libraries (such as mongo-driver). We obtain these dependencies through spring-boot-dependencies. Also, every spring version have different mongo related lib versions. We have tested them with different versions:

  1. spring 3.3.2 - no issues (or we never catch them)
  2. spring 3.3.4 - error occurs
  3. spring 3.3.5 - error occurs
  4. spring 3.4.0 - error occurs

Verification:
Since the issue is not consistent, we have examined the logs and checked for common causes such as missing classpath or empty BOOT-INF data and etc. Everything appears correct (and most of the runs are successful).

Error full stacktrace:
trace.txt

Notes:

  1. At different versions, sometimes we encounter a NoClassDefFoundError with other com/mongodb classes.
  2. Mongo FAQ that related to issue but looks like everything at our sine is correct. That why was decided that problem could be on spring side.
  3. Local Integration test + mongo testcontainer (not AWS DocumentDB) never get error.
  4. Maybe something related with 38611

Thank you @Osmyslitelny for reporting. Looking at the stack trace I do not see any actionable items from a data project perspective. Please report this to the Spring Boot team. As you mentioned this might be an issue with the class loader.