Use client plugin without changing the ClassLoaderContext
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
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
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