I'm currently working on a project with a plugin system using Java's ServiceLoader. The plugin manager creates an URL classloader with the URLs of the jar-files, which is used to load the plugins. When creating the EntityManagerFactory, I set the eclipselink.classloader
property to the created URL class loader, which should enfore the EntityManagerFactory to use my classloader for entity autodetection. However, Eclipselink fails to detect the entities in the plugins.
Eclipselink's logging (log level set to finest) does not mention the entities in the plugins at all, only the entities in the base project. I even tried pre-loading the entity and metamodel classes, but still no change.