testcontainers / testcontainers/testcontainers-java
Exception NoClassDefFoundError org/testcontainers/utility/PathUtils
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Hello
There is an exception in MountableFile, it does not find the class PathUtils when it calls recursiveDeleteDir from shutdownHook.
I think this is because during the shutdown hook the class loader is already closed by Maven and cannot be used to load new classes.
See attached stack trace
Exception in thread "Thread-17" java.lang.NoClassDefFoundError: org/testcontainers/utility/PathUtils$1
at org.testcontainers.utility.PathUtils.recursiveDeleteDir(PathUtils.java:26)
at org.testcontainers.utility.MountableFile.lambda$deleteOnExit$0(MountableFile.java:284)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.testcontainers.utility.PathUtils$1
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 3 more
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MountableFile.deleteOnExit and PathUtils.recursiveDeleteDir, the entry points shown in the stack trace. Reproduce the shutdown-hook failure under Maven and inspect whether class loading occurs after the loader closes. Done means cleanup completes without the NoClassDefFoundError and the relevant behavior is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100