[ 
https://issues.apache.org/jira/browse/MINIFI-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15768370#comment-15768370
 ] 

ASF GitHub Bot commented on MINIFI-128:
---------------------------------------

Github user apiri commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/68#discussion_r93533260
  
    --- Diff: 
minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/RunMiNiFi.java 
---
    @@ -1197,7 +1197,14 @@ public void start() throws IOException, 
InterruptedException {
             this.changeListener = new MiNiFiConfigurationChangeListener(this, 
defaultLogger);
             this.periodicStatusReporters = initializePeriodicNotifiers();
             startPeriodicNotifiers();
    -        this.changeCoordinator = initializeNotifier(this.changeListener);
    +        try {
    +            this.changeCoordinator = 
initializeNotifier(this.changeListener);
    +        } catch (Exception e) {
    --- End diff --
    
    As this is effectively our main, I am okay with this as this is our last 
stop before the stacktrace reaches user land.  In our current state this throws 
a RuntimeException which causes the JVM to exit as it bubbles up.  From my 
perspective, we cannot enumerate all possibilities at this point nor is there 
significant gain to do so and would potentially be bringing dependencies to 
this class/module.  We could optionally wrap this with another Exception class, 
but that doesn't seem to buy us much either.  Let me know your thoughts.


> NPE if nifi.minifi.notifier.file.config.path wasn't configured
> --------------------------------------------------------------
>
>                 Key: MINIFI-128
>                 URL: https://issues.apache.org/jira/browse/MINIFI-128
>             Project: Apache NiFi MiNiFi
>          Issue Type: Bug
>          Components: Agent Configuration/Installation
>    Affects Versions: 0.0.1
>         Environment: current master branch build
>            Reporter: Andrew Grande
>            Assignee: Aldrin Piri
>            Priority: Minor
>             Fix For: 0.2.0
>
>
> When enabling a FileChangeNotifier, it's easy to forget uncommenting the 
> *nifi.minifi.notifier.file.config.path* property (required). Minifi restart 
> will throw an unfriendly error:
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: Property, 
> nifi.minifi.notifier.file.config.path, for the path of the config file must 
> be specified.
>         at 
> org.apache.nifi.minifi.bootstrap.configuration.notifiers.FileChangeNotifier.initialize(FileChangeNotifier.java:154)
>         at 
> org.apache.nifi.minifi.bootstrap.RunMiNiFi.initializeNotifiers(RunMiNiFi.java:1452)
>         at 
> org.apache.nifi.minifi.bootstrap.RunMiNiFi.start(RunMiNiFi.java:1116)
>         at org.apache.nifi.minifi.bootstrap.RunMiNiFi.main(RunMiNiFi.java:224)
> Initiating shutdown of bootstrap change notifiers...
> Exception in thread "Thread-2" java.lang.NullPointerException
>         at 
> java.util.Collections$UnmodifiableCollection.<init>(Collections.java:1026)
>         at java.util.Collections$UnmodifiableSet.<init>(Collections.java:1128)
>         at java.util.Collections.unmodifiableSet(Collections.java:1118)
>         at 
> org.apache.nifi.minifi.bootstrap.RunMiNiFi.getChangeNotifiers(RunMiNiFi.java:1438)
>         at 
> org.apache.nifi.minifi.bootstrap.ShutdownHook.run(ShutdownHook.java:57)
> {noformat}
> Expected: improve the error message to be meaningful and suggest the user 
> configure the property. No stacktrace, as we know what's going on exactly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to