JiaLiangC opened a new pull request, #3955:
URL: https://github.com/apache/ambari/pull/3955

   …lections Upgrade
   
   ## What changes were proposed in this pull request?
   Ambari Component Installation Failure After Commons-Collections Upgrade
   Problem Description
    
   After upgrading Commons-Collections library, Ambari is failing to install 
components through the web interface. The specific error occurs when executing 
the credential creation command:
    
   ```bash
   /usr/lib/jvm/java-1.8.0/bin/java -cp "/var/lib/ambari-agent/cred/lib/*" 
org.apache.hadoop.security.alias.CredentialShell create 
javax.jdo.option.ConnectionPassword -value hive -provider 
jceks://file/var/lib/ambari-agent/cred/conf/hive_metastore/hive-site.jceks
   ```
    
   The command fails with the following error:
   ```
   Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/commons/collections/map/UnmodifiableMap
   at 
org.apache.hadoop.conf.Configuration$DeprecationContext.<init>(Configuration.java:409)
   at org.apache.hadoop.conf.Configuration.<clinit>(Configuration.java:448)
   at 
org.apache.hadoop.security.alias.CredentialShell.main(CredentialShell.java:442)
   Caused by: java.lang.ClassNotFoundException: 
org.apache.commons.collections.map.UnmodifiableMap
   at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   ```
    
   Root Cause
    
   The libraries in `/var/lib/ambari-agent/cred/lib/` directory are designed 
for Hadoop 2.x, but the system has been upgraded to use Hadoop 3.x. The 
upgraded Commons-Collections version is incompatible with the older Hadoop 
libraries, as it no longer contains the required `UnmodifiableMap` class which 
has been moved to a different package in newer versions.
    
   
   (Please fill in changes proposed in this fix)
   manual test
   
   before this patch
   
![image](https://github.com/user-attachments/assets/b0b36c19-6b33-40a3-8bec-74264d2932e7)
   
   
   after apply this patch
   
![image](https://github.com/user-attachments/assets/066a0d55-7955-44c4-95cd-7a7062c943e7)
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. Ex: unit tests, manual tests)
   (If this patch involves UI changes, please attach a screen-shot; otherwise, 
remove this)
   
   Please review [Ambari Contributing 
Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) 
before opening a pull request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to