Brandon DeVries created NIFI-5269:
-------------------------------------

             Summary: NiFi doesn't start if bootstrap.conf contatins a tmp dir 
which doesn't exist
                 Key: NIFI-5269
                 URL: https://issues.apache.org/jira/browse/NIFI-5269
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 1.6.0
            Reporter: Brandon DeVries


If a "java.io.tmpdir" argument is added to bootstrap.conf, and that directory 
does not exist, the PutHiveStreaming processor cannot be instantiated due to a 
SnappyError FAILED_TO_LOAD_NATIVE_LIBRARY.  A possible solution to this would 
be to add a check in RunNiFi.java[1]

 
{code:java}
final String tmpDirProperty = "-Djava.io.tmpdir=";
final List<String> javaAdditionalArgs = new ArrayList<>();

for (final Map.Entry<String, String> entry : props.entrySet()) {
     final String key = entry.getKey();
     final String value = entry.getValue();

     if (key.startsWith("java.arg")) {

          javaAdditionalArgs.add(value);

          if(value.startsWith(tmpDirProperty) 
               && value.length() > tmpDirProperty.length()){

               String tmpDir = value.subString(tmpDirProperty.length());
               Files.createDirectories(Paths.get(tmpDir));
          }
     }
}{code}
 

[1] 
[https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java#L964-L972]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to