ProviderMBeanRegistration.locateSessionFactory() NPE

Description

https://github.com/hibernate/hibernate-orm/pull/549

From the PR:

Protect SessionFactoryRegistry.getNamedSessionFactory(String) from NPE when the named SessionFactory hasn't been registered.

This problem occurs because ConcurrentHashMap does not support null keys, and throws a NullPointerException.

This can occur from ProviderMBeanRegistration.locateSessionFactory() when it checks to see whether the named SessionFactory is available on a background thread. It expects a null response to indicate that the SessionFactory has not been configured yet.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Brett Meyer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure