Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Contributor

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

avatar

@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.

avatar
Contributor

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.

avatar

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