Use Bundle Class Loader as a TCCL on Weld shutdown

Description

We hit a class loader leak issue in deltaspike. The BeanManagerProvider of deltaspike expects BeanManager related object to be removed here, it's a observer of the CDI BeforeShutdown event:
https://github.com/apache/deltaspike/blob/deltaspike-1.0.0/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java#L248

But since the TCCL is not a BundleClassLoader when BeforeShutdown event is sent, this fails on PAX CDI environment, eventually causes class loader leak. BundleClassLoader should be set as a TCCL in WeldCdiContainer#doStop() like doStart() is doing already.

Environment

None

Status

Assignee

Jean-Baptiste Onofre

Reporter

Tomohisa Igarashi

Labels

None

Fix versions

Affects versions

0.8.0

Priority

Major
Configure