You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Description
I've encountered an unexpected behavior with class loading when using a custom ClassLoader hierarchy with Flowable Engine. The engine appears to retain references to class instances from removed ClassLoaders, even after new versions of the same class are loaded through a different ClassLoader.
Create child custom loader3 and load class A again (let's call this instance address 22222):
/root custom loader
/child custom loader2
/child custom loader2-1
/child custom loader3
- A class (22222)
Start a new process instance with an instance of class A (22222) in variables.
Expected Behavior
When retrieving class A through variables in the second process instance, it should return the instance with address 22222 (loaded from child custom loader3).
Actual Behavior
When accessing class A through processEngineConfiguration's classLoader (root custom loader), it correctly returns the class with address 22222.
However, when accessing an instance of class A through process variables, it unexpectedly returns the instance with address 11111, which was loaded from the now-removed child custom loader1.
I think it suggests that Flowable Engine might be caching class instances or maintaining references to them even after their ClassLoader has been removed from the hierarchy. This could potentially lead to unexpected behavior in applications that rely on dynamic class loading.
Questions
Is this expected behavior?
If not, I would like to contribute to fixing this if it's an issue. Which areas of code should I look into first?
The text was updated successfully, but these errors were encountered:
I've investigated both Flowable's reflection code and my CustomClassLoader and found that this behavior was due to an incorrect parent ClassLoader configuration in my ChildCustomLoader.
I apologize for any confusion this may have caused.
Thanks.
Environment
Issue Description
I've encountered an unexpected behavior with class loading when using a custom ClassLoader hierarchy with Flowable Engine. The engine appears to retain references to class instances from removed ClassLoaders, even after new versions of the same class are loaded through a different ClassLoader.
ClassLoader Structure and Steps to Reproduce
class A
inchild custom loader1
(let's call this instance address 11111):class A
(11111) in variables.child custom loader1
from the hierarchy:child custom loader3
and loadclass A
again (let's call this instance address 22222):class A
(22222) in variables.Expected Behavior
When retrieving
class A
through variables in the second process instance, it should return the instance with address 22222 (loaded fromchild custom loader3
).Actual Behavior
class A
through processEngineConfiguration's classLoader (root custom loader), it correctly returns the class with address 22222.class A
through process variables, it unexpectedly returns the instance with address 11111, which was loaded from the now-removedchild custom loader1
.I think it suggests that Flowable Engine might be caching class instances or maintaining references to them even after their ClassLoader has been removed from the hierarchy. This could potentially lead to unexpected behavior in applications that rely on dynamic class loading.
Questions
The text was updated successfully, but these errors were encountered: