// Modules must be on the same classloader as Infinispan
// TODO revise this assumption
protected static List<ModuleLifecycle> moduleLifecycles = ModuleProperties.resolveModuleLifecycles(null);
Appears to be my immediate problem (number 2 above), Infinispan isn't loading the query module. I'm not sure how to resolve this, I'm not even sure yet if a bundle fragment will allow me to inject the classes into infinispan-core since it appears to use the System class loader. Am I wrong about that? Back to digging ...
Also as an FYI, this code in ModuleProperties.loadModuleProperties():
Collection<URL> resources = new FileLookup().lookupFileLocations(MODULE_PROPERTIES_FILENAME, cl);
if (resources == null)
throw new IOException("Could not find " + MODULE_PROPERTIES_FILENAME
+ " files on classpath for module " + moduleName);
The if (resources == null) condition will never be true because of:
Collection<URL> urls = new HashSet<URL>();
in FileLookup.getAsURLsFromClassLoader(). If it had, it might have been easier to figure out what was going wrong.
Infinispan uses the system classloader and the Infinispan classloader to try to load modules. Looks like this assumption is wrong in OSGi, please file a JIRA issue for this, we can try to unravel it a bit more ;-)
Please include the details you have dug up on this thread.