[
https://issues.apache.org/jira/browse/AMBARI-26323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jialiang Cai resolved AMBARI-26323.
-----------------------------------
Fix Version/s: 3.0.0
Resolution: Fixed
> Ambari Component Installation Failure After Commons-Collections Upgrade
> -----------------------------------------------------------------------
>
> Key: AMBARI-26323
> URL: https://issues.apache.org/jira/browse/AMBARI-26323
> Project: Ambari
> Issue Type: Bug
> Reporter: Jialiang Cai
> Assignee: Jialiang Cai
> Priority: Major
> Fix For: 3.0.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> ## 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.
>
> ## Solution
>
> Update the libraries in `/var/lib/ambari-agent/cred/lib/` to be compatible
> with Hadoop 3.x while ensuring backward compatibility with the credential
> creation process:
>
> 1. Replace the existing libraries with Hadoop 3.x compatible versions
> 2. Add the missing dependencies required by Hadoop 3.x
> 3. Include a compatible version of Commons-Collections (3.2.2) that contains
> the required `UnmodifiableMap` class
>
> This approach ensures that the credential creation process works correctly
> while maintaining compatibility with the upgraded Hadoop ecosystem.
>
> ## Implementation Steps
>
> 1. Back up the existing libraries
> 2. Download and add Hadoop 3.x compatible libraries
> 3. Include Commons-Collections 3.2.2 for backward compatibility
> 4. Update permissions on the new libraries
> 5. Test the credential creation command
> 6. Resume component installation through the Ambari web interface
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]