markap14 commented on a change in pull request #4376: URL: https://github.com/apache/nifi/pull/4376#discussion_r459702685
########## File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarClassLoaders.java ########## @@ -262,6 +263,15 @@ private InitContext load(final ClassLoader rootClassloader, narDirectoryBundleLookup.put(narDetail.getWorkingDirectory().getCanonicalPath(), new Bundle(narDetail, bundleClassLoader)); narCoordinateClassLoaderLookup.put(narDetail.getCoordinate().getCoordinate(), narClassLoader); narDetailsIter.remove(); + // Search for a NiFiServer implementation + ServiceLoader<NiFiServer> niFiServerServiceLoader = ServiceLoader.load(NiFiServer.class, narClassLoader); + for(NiFiServer server : niFiServerServiceLoader) { + if(serverInstance == null) { + serverInstance = server; + } else { + throw new IOException("Multiple implementations of NiFiServer found, there must be exactly one implementation."); Review comment: I tried adding both nifi-server-nar and minifi-server-nar into the lib/ directory. Indeed, I ran into this. But this error can probably be made a bit clearer, by listing the classnames of the NiFiServer implementations and the associated NAR's. For example: `Expected exactly one implementation of NiFiServer but found 2: JettyServer from nifi-server-nar-1.12.0-SNAPSHOT.nar, MiNiFiServer from minifi-server-nar-1.12.0-SNAPSHOT.nar` Or something to that effect. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org