> @Sanne, so here is the main rub with purely relying on the ORM ClassLoaderService. The ORM module cannot see certain classes and service files available to the Search module. So you still would need to try loading via the current class loader if the ORM class loader fails (or you would first try the current one, not sure!?).

Very good point, I missed that when thinking about this.

> In a perfect world I would somehow pass the current class loader to the ORM bootstrap, but that might be hard and timing wise too late.

No I think this is better: remember that WildFly is as fast as it is when booting because each component only has access to the classloader that it actually needs: that saves a lot of scanning across jars and also failed classloading attempts in the wrong module. ORM often needs to inspect classloaders (scanning for entities, loading of extensions) but doesn't need to scan the Search jars, so the current proposal couldn't be better ;-)