Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Issue in starting Ambari Server(HDP 2.5)

Issue in starting Ambari Server(HDP 2.5)

New Contributor

I am seeing below mentioned error which is causing Ambari-Server to stop.

java.lang.NoCLassDefFoundError : Could not initialize class javax.crytpto.JceSecurity

I started Ambari Server successfully. When i start Ambari agent then it got started but Ambari Server gets stopped. I check the logs and found above.

Thanks

3 REPLIES 3

Re: Issue in starting Ambari Server(HDP 2.5)

Super Mentor

@rahul gulati

Looks like you have installed a Java version without JCE. Which java are you using ?

Please share the java version detail as well.

# java -version

Have you installed unlimited strength cryptography in the JVM ? Please see:

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

.

Also i noticed a very strange spelling mistake in your error:

 Could not initialize class javax.crytpto.JceSecurity

.

Notice there is a typo mistake "javax.crytpto.JceSecurity" is that a typo mistake from your side? Or are you actually getting the same incorrect package name there? I think it should be "javax.crypto.JceSecurity"

Re: Issue in starting Ambari Server(HDP 2.5)

Super Mentor

@rahul gulati

Also in order to test further, On the host (Ambari Server host) where you are getting this error. Try running the following kind of simple java code "/tmp/TestJCE.java" to see if you are able to load the mentioned missing class.

public class TestJCE {
        public static void main(String ar[]) throws Exception {
                Class c = Class.forName("javax.crypto.JceSecurity");
                System.out.println("\n Able to Load Class: " + c);
        }
}

.

How to compile & run it ?

cd  /tmp
$JAVA_HOME/bin/javac TestJCE.java 
$JAVA_HOME/bin/java TestJCE
    Able to Load Class: class javax.crypto.JceSecurity

.

Make sure that you are using the same JAVA_HOME which is being used by the process that is showing the error "java.lang.NoCLassDefFoundError : Could not initialize class javax.crytpto.JceSecurity"

Re: Issue in starting Ambari Server(HDP 2.5)

Cloudera Employee

@rahul gulati

I agree with @Jay SenSharma. Problem seems to be with Java. 2 jars namely local_policy.jar and US_export_policy.jar needs to have full permission - "CryptoAllPermission" as shown below. Try to replicate it on your end.

[root@akhare-1 ~]# source /etc/hadoop/conf/hadoop-env.sh && zipgrep CryptoAllPermission $JAVA_HOME/jre/lib/security/local_policy.jar default_local.policy: permission javax.crypto.CryptoAllPermission;

[root@akhare-1 ~]# source /etc/hadoop/conf/hadoop-env.sh && zipgrep CryptoAllPermission $JAVA_HOME/jre/lib/security/US_export_policy.jar default_US_export.policy: permission javax.crypto.CryptoAllPermission;