LPS-49973 Inject the proper bean factory in plugins when sharding is enabled