Unable to load plugin: ClassNotFoundException


#1

linkerd version: 1.4.5
environment: ubuntu 16

I Created a custom plugin from linkerd-examples repo following this guide, https://linkerd.io/1/advanced/plugin/

I was able to build the jar file, header-classifier-assembly-0.1-SNAPSHOT.jar

After I import the jar file to the plugins directory, and run linkerd locally (https://linkerd.io/1/getting-started/locally/) I see the following error,

I have run linkerd in debug mode, I don’t see plugin loading from the logs,
./linkerd-1.4.5-exec config/linkerd.yaml -log.level=DEBUG

l5d_home

Error log:

IngressIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
java.lang.ClassNotFoundException: io.buoyant.http.identifiers.HelloWorldIdentifierInitializer
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)

#2

complete log

linkerd-sa$ ./linkerd-1.4.5-exec config/linkerd.yaml -log.level=DEBUG
-XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark -XX:InitialHeapSize=33554432 -XX:MaxHeapSize=1073741824 -XX:MaxNewSize=348966912 -XX:MaxTenuringThreshold=6 -XX:OldPLABSize=16 -XX:+PerfDisableSharedMem -XX:+PrintCommandLineFlags -XX:+ScavengeBeforeFullGC -XX:-TieredCompilation -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseStringDeduplication 
Jan 03, 2019 6:25:21 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1
INFO: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter(com.twitter.finagle.stats.MetricsExporter)
Jan 03, 2019 6:25:21 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1
INFO: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetricsExporter(com.twitter.finagle.stats.HostMetricsExporter)
I 0103 18:25:22.251 IST THREAD1: linkerd 1.4.5 (rev=0280009ca71e0673108a3752763938017bda588f) built at 20180713-153147
D 0103 18:25:22.276 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.H2Initializer for requested service io.buoyant.linkerd.ProtocolInitializer
D 0103 18:25:22.358 IST THREAD1: LoadService: loaded instance of class com.twitter.finagle.stats.MetricsHostStatsReceiver for requested service com.twitter.finagle.stats.HostStatsReceiver
D 0103 18:25:22.648 IST THREAD1: LoadService: loaded instance of class com.twitter.finagle.netty4.Netty4Init for requested service com.twitter.finagle.FinagleInit
D 0103 18:25:22.717 IST THREAD1: Toggle config resources found for com.twitter.finagle.netty4, using jar:file:/home/linkerd/linkerd-config/linkerd-sa/linkerd-1.4.5-exec!/com/twitter/toggles/configs/com.twitter.finagle.netty4.json
I 0103 18:25:23.022 IST THREAD1: Finagle version 18.7.0 (rev=271f741636e03171d61180f03f6cbfe532de1396) built at 20180710-150313
D 0103 18:25:23.280 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.HttpInitializer for requested service io.buoyant.linkerd.ProtocolInitializer
D 0103 18:25:23.329 IST THREAD1: Toggle config resources found for com.twitter.finagle.core, using jar:file:/home/linkerd/linkerd-config/linkerd-sa/linkerd-1.4.5-exec!/com/twitter/toggles/configs/com.twitter.finagle.core.json
D 0103 18:25:23.416 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.MuxInitializer for requested service io.buoyant.linkerd.ProtocolInitializer
D 0103 18:25:23.446 IST THREAD1: Toggle config resources found for com.twitter.finagle.mux, using jar:file:/home/linkerd/linkerd-config/linkerd-sa/linkerd-1.4.5-exec!/com/twitter/toggles/configs/com.twitter.finagle.mux.json
D 0103 18:25:23.455 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.ThriftInitializer for requested service io.buoyant.linkerd.ProtocolInitializer
D 0103 18:25:23.503 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.ThriftMuxInitializer for requested service io.buoyant.linkerd.ProtocolInitializer
D 0103 18:25:23.512 IST THREAD1: Toggle config resources found for com.twitter.finagle.thriftmux, using jar:file:/home/linkerd/linkerd-config/linkerd-sa/linkerd-1.4.5-exec!/com/twitter/toggles/configs/com.twitter.finagle.thriftmux.json
D 0103 18:25:23.536 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.RewritingNamerInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.538 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.consul.ConsulInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.540 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.fs.FsInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.542 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.k8s.K8sExternalInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.544 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.k8s.K8sInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.545 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.k8s.K8sNamespacedInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.547 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.marathon.MarathonInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.548 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.serversets.ServersetsInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.550 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.zk.ZkLeaderNamerInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.550 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.curator.CuratorInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.550 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.dnssrv.DnsSrvNamerInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.552 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.rancher.RancherInitializer for requested service io.buoyant.namer.NamerInitializer
D 0103 18:25:23.556 IST THREAD1: LoadService: loaded instance of class io.buoyant.interpreter.fs.FsInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.557 IST THREAD1: LoadService: loaded instance of class io.buoyant.interpreter.k8s.ConfigMapInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.559 IST THREAD1: LoadService: loaded instance of class io.buoyant.interpreter.k8s.istio.IstioInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.560 IST THREAD1: LoadService: loaded instance of class io.buoyant.interpreter.MeshInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.561 IST THREAD1: LoadService: loaded instance of class io.buoyant.namerd.iface.NamerdHttpInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.563 IST THREAD1: LoadService: loaded instance of class io.buoyant.namerd.iface.NamerdInterpreterInitializer for requested service io.buoyant.namer.InterpreterInitializer
D 0103 18:25:23.568 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.ConstTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.569 IST THREAD1: LoadService: loaded instance of class io.buoyant.namer.ReplaceTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.570 IST THREAD1: LoadService: loaded instance of class io.buoyant.transformer.k8s.DaemonSetTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.572 IST THREAD1: LoadService: loaded instance of class io.buoyant.transformer.k8s.LocalNodeTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.573 IST THREAD1: LoadService: loaded instance of class io.buoyant.transformer.perHost.LocalhostTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.575 IST THREAD1: LoadService: loaded instance of class io.buoyant.transformer.perHost.PortTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.576 IST THREAD1: LoadService: loaded instance of class io.buoyant.transformer.perHost.SpecificHostTransformerInitializer for requested service io.buoyant.namer.TransformerInitializer
D 0103 18:25:23.587 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.h2.HeaderTokenIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.588 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.h2.HeaderPathIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.589 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.h2.IngressIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.591 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.h2.istio.IstioIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.593 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.h2.istio.IstioIngressIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.594 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.HeaderIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.596 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.HeaderTokenIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.597 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.MethodAndHostIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.599 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.PathIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.600 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.StaticIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.601 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.IngressIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.603 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.istio.IstioIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
D 0103 18:25:23.605 IST THREAD1: LoadService: loaded instance of class io.buoyant.linkerd.protocol.http.istio.IstioIngressIdentifierInitializer for requested service io.buoyant.linkerd.IdentifierInitializer
java.lang.ClassNotFoundException: io.buoyant.http.identifiers.HelloWorldIdentifierInitializer
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.twitter.app.LoadService$.$anonfun$loadImpls$7(LoadService.scala:181)
	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:241)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.flatMap(TraversableLike.scala:241)
	at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:238)
	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
	at com.twitter.app.LoadService$.loadImpls(LoadService.scala:180)
	at com.twitter.app.LoadService$.apply(LoadService.scala:134)
	at com.twitter.app.LoadService$.apply(LoadService.scala:148)
	at com.twitter.finagle.util.LoadService$.apply(LoadService.scala:14)
	at io.buoyant.linkerd.Linker$.LoadedInitializers$lzycompute(Linker.scala:82)
	at io.buoyant.linkerd.Linker$.LoadedInitializers(Linker.scala:77)
	at io.buoyant.linkerd.Linker$.parse$default$2(Linker.scala:93)
	at io.buoyant.linkerd.Main$.loadLinker(Main.scala:72)
	at io.buoyant.linkerd.Main$.main(Main.scala:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.twitter.app.App.$anonfun$nonExitingMain$4(App.scala:364)
	at scala.Option.foreach(Option.scala:257)
	at com.twitter.app.App.nonExitingMain(App.scala:363)
	at com.twitter.app.App.nonExitingMain$(App.scala:344)
	at io.buoyant.linkerd.Main$.nonExitingMain(Main.scala:20)
	at com.twitter.app.App.main(App.scala:333)
	at com.twitter.app.App.main$(App.scala:331)
	at io.buoyant.linkerd.Main$.main(Main.scala:20)
	at io.buoyant.linkerd.Main.main(Main.scala)

#3

This worked! I deleted the identifier reference at
header-classifier/src/main/resources/META-INF/services/io.buoyant.linkerd.IdentifierInitializer

Because while compiling I removed scala directory located at plugins/header-classifier/src/main (IdentifierInitializer) due to compilation issue and therefore I need to delete the above file


closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.