Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Error: Could not find or load main class org.apache.nifi.properties.ConfigEncryptionTool

avatar
Expert Contributor
 resource_management.core.exceptions.ExecutionFailed: Execution of 'JAVA_HOME=/usr/jdk64/jdk1.8.0_77 /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/bin/encrypt-config.sh -v -b /usr/hdf/current/nifi/conf/bootstrap.conf -n /usr/hdf/current/nifi/conf/nifi.properties -f /var/lib/nifi/conf/flow.xml.gz -s '[PROTECTED]' -p '[PROTECTED]'' returned 1. Error: Could not find or load main class org.apache.nifi.properties.ConfigEncryptionTool
1 ACCEPTED SOLUTION

avatar
Expert Contributor

Ok here is the solution:

I modified the /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/bin/encrypt-config.sh

Added the line:

echo "The place it is looking is: ${CLASSPATH}"
The place it is looking is: /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/lib/*

Now I updated the permissions on the lib folder and contents, everything works now!

View solution in original post

3 REPLIES 3

avatar
Expert Contributor

bump, still need solution for this!

avatar
Expert Contributor

Ok, so if i run the command as root it works:

/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/bin/encrypt-config.sh -v -b /usr/hdf/current/nifi/conf/bootstrap.conf -n /usr/hdf/current/nifi/conf/nifi.properties -f /var/lib/nifi/conf/flow.xml.gz -s 'mypassword!' -p 'mypassword!'

2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool:        bootstrap.conf:                 /usr/hdf/current/nifi/conf/bootstrap.conf
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (src)  nifi.properties:                /usr/hdf/current/nifi/conf/nifi.properties
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (dest) nifi.properties:                /usr/hdf/current/nifi/conf/nifi.properties
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (src)  login-identity-providers.xml:   null
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (dest) login-identity-providers.xml:   null
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (src)  flow.xml.gz:                                    /var/lib/nifi/conf/flow.xml.gz
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: (dest) flow.xml.gz:                                    /var/lib/nifi/conf/flow.xml.gz
2017/03/06 09:41:57 INFO [main] org.apache.nifi.properties.NiFiPropertiesLoader: Loaded 116 properties from /usr/hdf/current/nifi/conf/nifi.properties
2017/03/06 09:41:58 INFO [main] org.apache.nifi.properties.NiFiPropertiesLoader: Loaded 116 properties from /usr/hdf/current/nifi/conf/nifi.properties
2017/03/06 09:41:58 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: Loaded NiFiProperties instance with 116 properties
2017/03/06 09:41:59 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: Decrypted and re-encrypted 46 elements for flow.xml.gz
2017/03/06 09:41:59 INFO [main] org.apache.nifi.properties.AESSensitivePropertyProvider: AES Sensitive Property Provider encrypted a sensitive value successfully
2017/03/06 09:41:59 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: Protected nifi.sensitive.props.key with aes/gcm/256 ->         FIQj+sLpEsqpQ8ON||Ph3aRfC5g6cVXoBap6a7okZ0rsIcOT4DzepNTA
2017/03/06 09:41:59 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: Updated protection key nifi.sensitive.props.key.protected
2017/03/06 09:41:59 INFO [main] org.apache.nifi.properties.ConfigEncryptionTool: Final result: 117 keys including 1 protected keys

When I run it as Nifi:

Error: Could not find or load main class org.apache.nifi.properties.ConfigEncryptionTool

avatar
Expert Contributor

Ok here is the solution:

I modified the /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/bin/encrypt-config.sh

Added the line:

echo "The place it is looking is: ${CLASSPATH}"
The place it is looking is: /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/files/nifi-toolkit-1.1.0.2.1.1.0-2/lib/*

Now I updated the permissions on the lib folder and contents, everything works now!