Support Questions
Find answers, ask questions, and share your expertise

Hive server2 throws java.lang.NoClassDefFoundError: Could not initialize class net.sf.jpam.Pam


Hi all,

I have HDP2.6 running. I've configured Hiveserver2 authentication to use PAM. I've set

When I use beeline to connect to hive instance, hive-server2.err shows the following stacktrace:

Exception in thread "HiveServer2-Handler-Pool: Thread-118" java.lang.NoClassDefFoundError: Could not initialize class net.sf.jpam.Pam
        at org.apache.hive.service.auth.PamAuthenticationProviderImpl.Authenticate(
        at org.apache.hive.service.auth.PlainSaslHelper$PlainServerCallbackHandler.handle(
        at org.apache.hive.service.auth.PlainSaslServer.evaluateResponse(
        at org.apache.thrift.transport.TSaslTransport$SaslParticipant.evaluateChallengeOrResponse(
        at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(
        at org.apache.thrift.server.TThreadPoolServer$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

I've checked hive log (hiveserver2.log) and upon startup, I could see that jpam-1.1.jar is specified in the classpath.

Is there something I'm missing?



@Mike Lok

Please review the following article and validate your PAM configuration:

Also verify if your passwd file has correct permission and is in correct format.


*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.


Thanks for the link to the KB. I've performed all the steps listed in the KB article except for running hive server process as root/super user. Is there an article on how I can achieve that?

Having said, I've restarted hive server and tried to login via beeline. The same exception is still being thrown. Not sure if the jpam JAR file or the file is being loaded correctly.


Don't run it as root, that should not be required. Are you using Ambari to manage the cluster? If yes make sure you do all this changes thru ambari ui.


Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.