[ 
https://issues.apache.org/jira/browse/HCATALOG-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169752#comment-13169752
 ] 

Julien Le Dem commented on HCATALOG-10:
---------------------------------------

@Ashutosh

Actually the first error is thrown when the Security class is loaded (or fails 
to load because of it's dependency on hadoop.security), before the method 
handleSecurity() can be called.
This is why the Security class is not referred to outside the try block.
In my test the loading fails with a ClassNotFoundException on the first 
required hadoop.security class.
You can not get a NoSuchMethodError if the class containing the method can not 
be loaded (you get a NoClassDefFoundError first).
I'm checking the message in the exception to make sure I am not masking a 
different issue.

We could have a more proactive approach: In HCatOutputFormat check for the 
existence of "org.apache.hadoop.security.UserGroupInformation"
that would be more explicit. What do you think?
{code}
try {
  // checking the presence of the Hadoop security package
  Class.forName("org.apache.hadoop.security.UserGroupInformation");
  Security.getInstance().handleSecurity(job, outputJobInfo, client, conf, 
harRequested);
} catch (NoClassDefFoundError e) {
  // if hadoop security is not present we are working with a version of hadoop 
which does
  // not do security
  if (!e.getMessage().startsWith("org/apache/hadoop/security")) {
    throw e;
  }
}
{code}
                
> Shouldn't assume the secure hadoop installation
> -----------------------------------------------
>
>                 Key: HCATALOG-10
>                 URL: https://issues.apache.org/jira/browse/HCATALOG-10
>             Project: HCatalog
>          Issue Type: Bug
>    Affects Versions: 0.1
>            Reporter: Devaraj Das
>            Assignee: Julien Le Dem
>         Attachments: HCAT-10.patch
>
>
> HCatalog currently only builds against Hadoop 20S. It should successfully 
> build against hadoop-0.20 as well. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to