Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown hook #3889

Closed
auriium opened this issue Mar 16, 2021 · 2 comments
Closed

Shutdown hook #3889

auriium opened this issue Mar 16, 2021 · 2 comments

Comments

@auriium
Copy link

auriium commented Mar 16, 2021

Launching a testcontainer in a maven plugin in order to generate code conveniently with jooq and flyway, but on shutdown i get this exception:

Exception in thread "Thread-5" java.lang.NoClassDefFoundError: org/testcontainers/utility/PathUtils at org.testcontainers.utility.MountableFile.lambda$deleteOnExit$0(MountableFile.java:292) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.ClassNotFoundException: org.testcontainers.utility.PathUtils 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) ... 2 more

It always arrives after the build success/failure message from Maven, and although it doesn't fail builds directly, it seems to fail
them consistently on my CI platform.

I believe this has something to do with how testcontainers and maven interact with shutdown hooks, and if so a possible solution
would be to add an API method to allow the starting of a testcontainer without shutdown hooks (That way hacky solutions like
intercepting the shutdown hook via reflection don't need to be used to ensure that if used in a maven plugin it does not fail the build)

@auriium
Copy link
Author

auriium commented Mar 17, 2021

#1454

@bsideup
Copy link
Member

bsideup commented Mar 17, 2021

Duplicate of #1454 (see my answer there)

@bsideup bsideup closed this as completed Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants