From f5aeb8147302138c74127c312b2f3af661c98da7 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 20 Nov 2018 22:02:10 +0100 Subject: [PATCH] SerializedBeanFactoryReference falls back to dummy with specific id Issue: SPR-17508 --- .../beans/factory/support/DefaultListableBeanFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 5bb1c57764..4adf7a775f 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -1748,7 +1748,9 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto } } // Lenient fallback: dummy factory in case of original factory not found... - return new DefaultListableBeanFactory(); + DefaultListableBeanFactory dummyFactory = new DefaultListableBeanFactory(); + dummyFactory.serializationId = this.id; + return dummyFactory; } }