Hi! You can set the classloader.parent-first-patterns.additional configuration to load additional classes from the lib directory. See [1] for more details.
What classes are causing the ClassNotFoundException? From the default value of classloader.parent-first-patterns.default all classes in org.apache.flink package should be loaded correctly. [1] https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/ops/debugging/debugging_classloading/#inverted-class-loading-and-classloader-resolution-order Fan Xie <f...@linkedin.com> 于2022年3月23日周三 07:43写道: > Hi Flink Community, > > Recently I implemented a new metrics reporter to report Flink runtime > metrics to a Kafka topic. After building the project, I move my reporter > jar file from my build folder to the plugin folder: > > COPY build/flink-diagnostics-message-reporter-${VERSION}.jar > ${FLINK_HOME}/plugins/flink-diagnostics-message-reporter/flink-diagnostics-message-reporter.jar > > > But then I see lots of ClassNotFoundException when I tried to start a test > job with this new metrics reporter. Looks like the problem is that the > metrics reporter plugin can not get access to some of the jars in the > /opt/flink/lib folder. By reading this document: > https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/filesystems/plugins/, > looks like there is a whitelist to define what packages can be accessed by > the plugins. Is there any way to config this whitelist so that the plugin > jar can get accessed to classes in this folder? If this can't work, are > there other solutions for this problem like changing the classpath for the > plugin? > Plugins | Apache Flink > <https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/filesystems/plugins/> > Plugins # Plugins facilitate a strict separation of code through > restricted classloaders. Plugins cannot access classes from other plugins > or from Flink that have not been specifically whitelisted. This strict > isolation allows plugins to contain conflicting versions of the same > library without the need to relocate classes or to converge to common > versions. > nightlies.apache.org > > Best, > Fan >