AnsweredAssumed Answered

"YouShouldntSeeThisErrorUnlessYourJVMhadoop.loginPropertiesAreBad"

Question asked by cronysatish on Dec 15, 2016
Latest reply on Jan 17, 2017 by maprcommunity
Branched to a new discussion

Hi All,

 

I am trying to run simple kerberized java client on my server.

$javac -cp $(hadoop classpath) MapRTest.java

 

Code:

import java.net.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.security.UserGroupInformation;
public class MapRTest {
public static void main(String args[]) throws Exception {
byte buf[] = new byte[65 * 1024];
int ac = 0;
if (args.length != 1) {
System.out.println("usage: MapRTest pathname");
return;
}
Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("ec2-user@EXAMPLE1.COM",
"ec2-user.keytab");
FileSystem fs = FileSystem.get(conf);
}
}

 

I got below error.  Can you please help me fix this.

Error:

$ java -cp .:$(hadoop classpath) MapRTest /test
16/12/15 05:08:21 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.io.IOException: Login failure for ec2-user@EXAMPLE1.COM from keytab ec2-user.keytab: javax.security.auth.login.LoginException: unable to find LoginModule class: YouShouldntSeeThisErrorUnlessYourJVMhadoop.loginPropertiesAreBad
at org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:907)
at MapRTest.main(MapRTest.java:17)
Caused by: javax.security.auth.login.LoginException: unable to find LoginModule class: YouShouldntSeeThisErrorUnlessYourJVMhadoop.loginPropertiesAreBad
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:794)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
at org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:897)
... 1 more

 

Thanks,

Sathish.

Outcomes