Hi,

I'm having difficulties setting up an AnalysisEngine containing JCas Annotators and a Ruta script that calls extension functions using the Play framework. Since the Play framework uses its own hierarchy of classloaders, the system classloader somehow does not find the extension classes.

When creating the type system and descriptors for the Ruta script, I can pass the classloader used by the framework through the RutaBuildOptions. But when creating an AnalysisEngine, the initializeExtensionWithClassPath() method in the RutaEngine class does only use Class.forName(each) to instanciate the extensions. When replacing this call with

this.resourceManager.getExtensionClassLoader().loadClass(each);

and setting the manager's classloader to the one used by the framework, the extensions get instanciated and the execution of the rule succeedes. Is this behaviour expected and is there a way around this without having to change the RutaEngine class? Please find the relevant parts of my source code here: https://gist.github.com/zekrg/42d0bea5a2c9c561d152a6df268318d5.

Thanks for your help.

Reply via email to