Allow for Hibernate extensions discovery via OSGi blueprints

Description

It is not possible to use a ServiceContributor when using the OSGi boostrap via OsgiSessionFactoryService. The getService method:

1 2 3 4 5 6 7 @Override public Object getService(Bundle requestingBundle, ServiceRegistration registration) { osgiClassLoader.addBundle( requestingBundle ); // ... return configuration.buildSessionFactory( serviceRegistry ); }

throws an org.hibernate.service.UnknownServiceException. This is due to the fact the contributor is not discovered via the Java Service Loader mechanism. OsgiSessionFactoryService should handle contributors in a similar fashion as integrators and look them up via the OSGi ServiceTracker.

Also, the code should add some error handling. Currently an exception seems to get just swallowed.

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Hardy Ferentschik

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure