[
https://issues.apache.org/jira/browse/SLING-3464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13949104#comment-13949104
]
Radu Cotescu commented on SLING-3464:
-------------------------------------
The {{PackageAdminClassLoader}} checks the bundle state before solving a class.
Since declarative services won't get solved from a bundle which is not in the
ACTIVE state, I think class loading should work the same.
Imagine this corner use-case:
1. you have a bundle com.example.bundle in an ACTIVE state
2. you load class A from it
3. the bundle transitions to RESOLVED
4. you want to load class B from it (this will fail)
You get into the weird situation where you still solve A and instantiate it in
your code, but you can't load B or access any service provided by the bundle.
> The DynamicClassLoaderManager doesn't reload classes when a bundle
> transitions from STARTED to RESOLVED
> -------------------------------------------------------------------------------------------------------
>
> Key: SLING-3464
> URL: https://issues.apache.org/jira/browse/SLING-3464
> Project: Sling
> Issue Type: Bug
> Components: Commons
> Affects Versions: Commons ClassLoader 1.3.0
> Reporter: Radu Cotescu
> Fix For: Commons ClassLoader 1.3.2
>
>
> The bundle activator from org.apache.sling.commons.classloader also acts as a
> SynchronousBundleListener, taking care to clean the DynamicClassLoaderManager
> (DCLM) when a bundle changes its state.
> However, the DCLM doesn't get cleaned when a bundle transitions from STARTED
> to RESOLVED, which is inconsistent: for example no services will be resolved
> from that bundle, however classes already loaded through DCLM will get solved.
--
This message was sent by Atlassian JIRA
(v6.2#6252)