Resolve error (RuntimeManager with id default-singleton is already active) when a spring bean was destroyed and recreated, refactor