[
https://issues.apache.org/jira/browse/NIFI-1454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125502#comment-15125502
]
James Wing commented on NIFI-1454:
----------------------------------
Your patch looks pretty good. I verified that the build works, and that the
generated RPM successfully installs. I also compared the file listings between
the built RPM, the build .tar.gz, and an 0.4.1 .tar.gz to confirm expected
changes and watch for unexpected effects (attached).
There appears to be a typo in the Java Mail dependency spec. The RPM installs
and runs mostly fine, until you configure email notifications, then I got an
exception. The current spec is:
{code:xml|title=nifi-assembly/pom.xml:543|borderStyle=solid}
<include>java.mail:mail</include>
{code}
Instead, I believe it should be "javax.mail":
{code:xml|title=nifi-assembly/pom.xml:543|borderStyle=solid}
<include>javax.mail:mail</include>
{code}
I like the solution approach. Defining the explicit include list of bootstrap
dependencies results in fewer duplicate files installed. It is not necessary
to maintain a long list of NAR file excludes. The simplified 'nifi' name is
also much appreciated.
However, it is necessary to maintain the list of explicit bootstrap includes,
and forgetting to do so will break the resulting RPM installation. I believe
this is a reasonable trade, given that changes to the bootstrap dependencies
are likely to be much fewer and farther between than NAR additions, and more
likely to be performed and reviewed by experienced contributors.
Your solution is better than mine, this looks like the best option available
with the rpm-maven-plugin. Nice work.
> Built RPMs Do Not Result in Working NiFi Installation
> -----------------------------------------------------
>
> Key: NIFI-1454
> URL: https://issues.apache.org/jira/browse/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
> Assignee: Joseph Witt
> Priority: Minor
> Labels: build
> Fix For: 0.5.0
>
> Attachments:
> 0001-NIFI-1454-fixed-rpm-name-bootstrap-deps-updated-rpm-.patch,
> rpm_file_compare.zip
>
>
> 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 :
> {noformat}
> # ./nifi.sh 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(Class.java:2625)
> at java.lang.Class.getMethod0(Class.java:2866)
> at java.lang.Class.getMethod(Class.java:1676)
> at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
> at
> sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
> Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> ... 6 more
> {noformat}
> 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
(v6.3.4#6332)