diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshot.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshot.java index a91af8e7..cb0b726d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshot.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshot.java @@ -248,7 +248,12 @@ public class SerializedFlowExecutionSnapshot extends FlowExecutionSnapshot imple public ConfigurableObjectInputStream(InputStream in, ClassLoader classLoader) throws IOException { super(in); - this.classLoader = classLoader; + this.classLoader = initClassLoader(classLoader); + } + + private static ClassLoader initClassLoader(ClassLoader defaultClassLoader) { + ClassLoader result = Thread.currentThread().getContextClassLoader(); + return result != null ? result : defaultClassLoader; } protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {