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

Steve Loughran commented on HADOOP-15808:
-----------------------------------------

Followup, this isn't enough: token.toString() will raise an exception if 
there's any token which doesn't load
{code}
    
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/example/auth/TokenIdentifier
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at 
org.apache.hadoop.security.token.Token.getClassForIdentifier(Token.java:158)
    at org.apache.hadoop.security.token.Token.decodeIdentifier(Token.java:185)
    at 
org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.printTokensToString(DelegationTokenFetcher.java:224)
    at 
org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.printTokens(DelegationTokenFetcher.java:244)
    at 
org.apache.hadoop.hdfs.tools.DelegationTokenFetcher$1.run(DelegationTokenFetcher.java:139)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
    at 
org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.main(DelegationTokenFetcher.java:135)
    at 
org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.main(DelegationTokenFetcher.java:72)
Caused by: java.lang.ClassNotFoundException: 
com.google.cloud.hadoop.fs.gcs.auth.AbstractGCPTokenIdentifier
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 27 more
{code}



> Harden Token service loader use
> -------------------------------
>
>                 Key: HADOOP-15808
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15808
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>    Affects Versions: 2.9.1, 3.1.2
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Major
>             Fix For: 3.1.2, 3.2.1
>
>         Attachments: HADOOP-15808-001.patch, HADOOP-15808-002.patch, 
> HADOOP-15808-003.patch
>
>
> The Hadoop token service loading (identifiers, renewers...) works provided 
> there's no problems loading any registered implementation. If there's a 
> classloading or classcasting problem, the exception raised will stop all 
> token support working; possibly the application not starting.
> This matters for S3A/HADOOP-14556 as things may not load if aws-sdk isn't on 
> the classpath. It probably lurks in the wasb/abfs support too, but things 
> have worked there because the installations with DT support there have always 
> had correctly set up classpaths.
> Fix: do what we did for the FS service loader. Catch failures to instantiate 
> a service provider impl and skip it



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to