1. adding envers into org.hibernate module in as7, so user's app
can see both hibernate and envers class
(with an separate envers module i ran into some cycle dependency issue)
So something depends on Envers?
2. envers throws "listeners were not registed" exception,
means hibernate's IntegratorServiceImpl can't see envers class/resource
IntegratorServiceImpl is using java.util.ServiceLoader#load(Class<S> service),
which internally using TCCL, (I think)
that's the reason why core can't see envers' integrator.
so, i created a custom ServiceLoader which use ClassLoaderService to find the integrator,
but this doesn't work either.
since, we need
(META-INF/services/org.hibernate.integrator.spi.Integrator) and ClassLoaderServiceImpl
using resourceClassLoader to do this.
by default, resourceClassLoader is set to applicationClassLoader in
then, i changed IntegratorServiceImpl to use java.util.ServiceLoader#load(Class<S>
), test pass, but this of course is not the fix.
so, i changed the custom ServiceLoader to use classLoaderService to locateResources
first, and using ServiceLoader.class.getClassLoader() to reload the resource again.
here are the changes:
I wish I could help here, but regarding Integrators and the way they are discovered I
guess Steve is the best person :).
Although if it's working - great!