Affects Version/s: 2.4.4
Component/s: Core: Flow Engine: Flow Builder
Upgrading to Spring (Context) v 4.3.X breaks backwards compatibility in Spring WebFlow.
The following commit upgrades from 4.2.X to 4.3.X:
Update minor versions of dependencies (commit 0dc8b52c72696ade87c59c1f79c6c107fae9fb53)
Spring context changed between 4.2.X and 4.3.X, particularly https://jira.spring.io/browse/SPR-14626 gave rise to a change in GenericApplicationContext where the ResourceLoader is now also being used as a class loader.
This behaviour can be made backwards compatible by setting a custom class loader - e.g. the same class loader as previously.
Asumme you have a multi class loader environment
WebApp (contains code and flow xml)
Server (contains spring and spring-webflow)
In FlowModelFlowBuilder, the ResourceLoader is set (which incidentally overrides the class loader in spring (context) 4.3.X):
This will of course cause a ClassNotFoundException to be thrown when trying to load domain classes.
This is due to the fact that in the project setup, the webflow code is in another classloader than the domain code.
To be backwards compatible, the fix is quite simple - we need to memoize the classLoader, before overriding it with the resource loader