nifi: NoClassDefFoundError - AbstractListProcessor -
i'm extending standard processor create custom nifi processor. project builds fine. but, when restart nifi after adding newly generated nar lib/ directory, nifi fails start noclassdeffounderror:
java.lang.noclassdeffounderror: org/apache/nifi/processor/util/list/abstractlistprocessor @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:763) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:467) @ java.net.urlclassloader.access$100(urlclassloader.java:73) @ java.net.urlclassloader$1.run(urlclassloader.java:368) @ java.net.urlclassloader$1.run(urlclassloader.java:362) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:361) @ java.lang.classloader.loadclass(classloader.java:424) @ java.lang.classloader.loadclass(classloader.java:357) @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:763) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:467) @ java.net.urlclassloader.access$100(urlclassloader.java:73) @ java.net.urlclassloader$1.run(urlclassloader.java:368) @ java.net.urlclassloader$1.run(urlclassloader.java:362) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:361) @ java.lang.classloader.loadclass(classloader.java:424) @ java.lang.classloader.loadclass(classloader.java:357) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:348) @ java.util.serviceloader$lazyiterator.nextservice(serviceloader.java:370) @ java.util.serviceloader$lazyiterator.next(serviceloader.java:404) @ java.util.serviceloader$1.next(serviceloader.java:480) @ org.apache.nifi.nar.extensionmanager.loadextensions(extensionmanager.java:138) @ org.apache.nifi.nar.extensionmanager.discoverextensions(extensionmanager.java:113) @ org.apache.nifi.web.server.jettyserver.start(jettyserver.java:699) @ org.apache.nifi.nifi.<init>(nifi.java:160) @ org.apache.nifi.nifi.main(nifi.java:267)
can me understand if i'm missing here.
i'm using following dependencies in processor-bundle's pom.xml:
<dependency> <groupid>org.apache.nifi</groupid> <artifactid>nifi-api</artifactid> <version>1.3.0</version> </dependency> <dependency> <groupid>org.apache.nifi</groupid> <artifactid>nifi-standard-processors</artifactid> <version>1.3.0</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.apache.nifi</groupid> <artifactid>nifi-processor-utils</artifactid> <version>1.3.0</version> </dependency> <dependency> <groupid>org.apache.nifi</groupid> <artifactid>nifi-utils</artifactid> <version>1.3.0</version> </dependency>
my imports in code:
import org.apache.commons.io.ioutils; import org.apache.nifi.components.propertydescriptor; import org.apache.nifi.flowfile.attributes.coreattributes; import org.apache.nifi.processor.processcontext; import org.apache.nifi.processor.util.standardvalidators; import org.apache.nifi.processor.util.list.abstractlistprocessor; import org.apache.nifi.processors.standard.util.fileinfo; import org.apache.nifi.processors.standard.util.filetransfer; import org.apache.nifi.processors.standard.listfile;
generally processors aren't meant extended , better not have dependency on nifi-standard-nar. nifi-processor-utils project exists hold common code share across processors abstractlistprocessor:
https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-extension-utils
if there other code in nifi-standard-processors should shared should @ refactoring , moving modules under nifi-extension-utils.
for now, better off copying , pasting listfile, filetransfer, , fileinfo own project , modifying them accordingly, , remove dependency on nifi-standard-processors.
to answer specific question why exception... because nar needs have nar dependency on nifi-standard-nar in order resolve classes @ runtime. wiki page shows example same situation:
Comments
Post a Comment