apache / apache/maven

[MNG-5589] Investigate how plugin classloaders are shutdown

Open
#6,470 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Jason van Zyl](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jvanzyl)** opened **[MNG-5589](https://issues.apache.org/jira/browse/MNG-5589?redirect=false)** and commented

http://www.mail-archive.com/dev@maven.apache.org/msg99645.html

Stuart's analysis of the above thread:
I suspect this is related to the change in Classworlds 2.4.1+ to use the
new ClassLoader.close() method available in Java7 to forcibly close plugin
ClassLoaders when the plugin/container realm is disposed. This happens
after the Maven build is finished, but before JVM shutdown hooks run.

Any plugin that registers a JVM shutdown hook which tries to load
classes/resources from the original plugin realm will throw a NCDFE -
you'll probably see similar issues if a plugin forks threads that are still
running after the plugin/container realm has been disposed and subsequently
try to load classes.

( note that the same error will likely occur with Maven 3.1.1 since it uses
the same version of Classworlds )

---

**Affects:** 3.2.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.