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.

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

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

Explorer

Hi all,

I have HDP2.6 running. I've configured Hiveserver2 authentication to use PAM. I've set hive.server2.authentication.pam.services=passwd.

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(PamAuthenticationProviderImpl.java:43)
        at org.apache.hive.service.auth.PlainSaslHelper$PlainServerCallbackHandler.handle(PlainSaslHelper.java:106)
        at org.apache.hive.service.auth.PlainSaslServer.evaluateResponse(PlainSaslServer.java:102)
        at org.apache.thrift.transport.TSaslTransport$SaslParticipant.evaluateChallengeOrResponse(TSaslTransport.java:539)
        at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:283)
        at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)
        at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:269)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

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?

Thanks.

3 REPLIES 3

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

@Mike Lok

Please review the following article and validate your PAM configuration: https://community.hortonworks.com/content/supportkb/48753/how-to-use-pam-for-hiveserver2-authenticat...

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

HTH

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

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

Explorer

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 libjpam.so file is being loaded correctly.

Thanks.

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

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.

HTH

Don't have an account?
Coming from Hortonworks? Activate your account here