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

Freeman Fang edited comment on CXF-7361 at 10/26/18 4:27 AM:
-------------------------------------------------------------

Since JDK 11 won't have Unsafe.defineClass anymore, we need to use 
MethodHandles.Lookup.defineClass instead, which exists since JDK9


was (Author: ffang):
Since JDK 11 won't have Unsafe.defineClass anymore, we need to use 
MethodHandles.Lookup.defineClass instead 

> Java 9 support for CXFAuthenticator
> -----------------------------------
>
>                 Key: CXF-7361
>                 URL: https://issues.apache.org/jira/browse/CXF-7361
>             Project: CXF
>          Issue Type: Improvement
>    Affects Versions: 3.1.11
>            Reporter: Romain Manni-Bucau
>            Assignee: Freeman Fang
>            Priority: Major
>
> with java 9, Authenticator getDefault() should be used instead of field.get() 
>  (setAccessible fails)  + unsafe should be used to define the class instead 
> of the failing ClassLoader.defineClass.
> All that with reflection of course and in fallback mode probably since for 
> java 8 it is better to not do it (or it is not available - getDefault() 
> typically).
> Workaround ATM is to call CXFAuthenticator.addAuthenticator(); manually and 
> ignore the exception, it initializes the instance then it doesn't fail but 
> the feature is lost until it gets fixed as mentionned before.



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

Reply via email to