Use client plugin without changing the ClassLoaderContext

Questions and answers on developing, deploying and using plugins and JavaBeans

Use client plugin without changing the ClassLoaderContext

Postby D.Bilinger » Wed Apr 03, 2024 12:19 pm

Hello everyone,

I have implemented a client plugin in Servoy. This contains Java methods written with the Java API from the Apache Spark data processing framework. The problem is that using the Apache Spark Java API only works if the same ContextClassLoader is used to call the functions that was used to load the JAR files. I have noticed that the WebAppClassLoader from the Tomcat server has a separate ContextClassLoader for the plugins, beans, lib and ROOT folders, among others. When starting an application server, it uses the context from ROOT, as the client plugin is located in the plugins folder and the dependencies for the plugin are also in this folder. Is it currently necessary to change the context for the plugins folder in the current thread. My question would be whether it is possible to avoid changing the context or to add the JAR for the client plugin and the JARs for the dependencies to the context ROOT, since apparently the Servoy Developer no longer recognizes the client plugin if you add it to the .../servoy/application_server/server/webapps/ROOT/WEB-INF/lib/ folder.
Thank you in advance for your answers.

With kind regards

Daniel Bilinger
D.Bilinger
 
Posts: 1
Joined: Wed Apr 03, 2024 11:21 am

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 1 guest