nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Wing (JIRA)" <>
Subject [jira] [Created] (NIFI-1454) Built RPMs Do Not Result in Working NiFi Installation
Date Sun, 31 Jan 2016 00:36:39 GMT
James Wing created NIFI-1454:

             Summary: Built RPMs Do Not Result in Working NiFi Installation
                 Key: NIFI-1454
             Project: Apache NiFi
          Issue Type: Bug
          Components: Tools and Build
    Affects Versions: 0.4.1
         Environment: Tested on Amazon Linux with Java 7
            Reporter: James Wing
            Priority: Minor

After building an RPM (mvn clean install -Prpm) and installing it (Amazon Linux, Java 1.7.0_91),
I ran into the following error attempting to start NiFi :

# ./ start

Java home: /usr/lib/jvm/java
NiFi home: /opt/nifi/nifi-0.4.1

Bootstrap Config File: /opt/nifi/nifi-0.4.1/conf/bootstrap.conf

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.getMainMethod(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 6 more

But the .tar.gz assembly file from the same build works just fine.  Comparing listings of
the two file sets, it appears that the .tar.gz assembly has complete set of jar files in lib/bootstrap:

* activation-1.1.jar
* antlr-runtime-3.5.2.jar
* commons-lang3-3.4.jar
* logback-classic-1.1.3.jar
* logback-core-1.1.3.jar
* mail-1.4.7.jar
* nifi-api-0.4.1.jar
* nifi-bootstrap-0.4.1.jar
* nifi-expression-language-0.4.1.jar
* nifi-processor-utils-0.4.1.jar
* nifi-security-utils-0.4.1.jar
* nifi-utils-0.4.1.jar
* slf4j-api-1.7.12.jar

while the RPM install's lib/bootstrap has only one of these:

* nifi-bootstrap-0.4.1.jar

So I tried to troubleshoot why this is.  It looks like the nifi-assembly POM is set up to
use the same defined set of dependencies for both the maven-assembly-plugin and rpm-maven-plugin
plugins.  The lib folder plan for both plugins is something like:

lib - all dependencies except nifi-bootstrap
lib/bootstrap - include only nifi-bootstrap

The problem appears to be a difference between how the two plugins handle transitive dependencies.
 The maven-assembly-plugin has configuration options allowing us to specify that the exclusions
apply to the named plugins AND their transitive dependencies.  The rpm-maven-plugin does not
have a transitive configuration option, and does not appear to do the same thing by default.
 In fact, the RPM is built with nifi-bootstrap-0.4.1.jar in the lib/bootstrap folder, but
all of its transitive dependencies (such as slf4j from the error) are in the lib folder. 
I believe the RPM installs LICENSE and NOTICE in the docs folder for the same reason.

This message was sent by Atlassian JIRA

View raw message