Spring singletonbeans are created once for each application context. That is, if you create multiple application contexts from the same configuration, they will have different instances of singleton beans.
If you want them to share a single instance of a singleton bean, you can declare it in the context of the parent application and provide your multiple contexts to this parent context when they are created.
source
share