caijialiang created RANGER-4201:
-----------------------------------

             Summary: Hbase master can't start due to  ranger-hbase-plugin 
jersey jar conflict
                 Key: RANGER-4201
                 URL: https://issues.apache.org/jira/browse/RANGER-4201
             Project: Ranger
          Issue Type: Bug
          Components: Ranger
    Affects Versions: 2.4.0, 2.3.0
            Reporter: caijialiang


hbase version 2.4.13

ranger version 2.4

hbase  master can't start after installed ranger-hbase-plugin 

 
{code:java}
ERROR [master/gs-server-13481:16000:becomeActiveMaster] master.HMaster: ***** 
ABORTING master gs-server-13481,16000,1681377561702: The coprocessor 
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor threw 
java.lang.ExceptionInIniti
alizerError *****
java.lang.ExceptionInInitializerError
        at 
com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:182)
        at 
com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:175)
        at 
com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
        at com.sun.jersey.api.client.Client.init(Client.java:343)
        at com.sun.jersey.api.client.Client.access$000(Client.java:119)
        at com.sun.jersey.api.client.Client$1.f(Client.java:192)
        at com.sun.jersey.api.client.Client$1.f(Client.java:188)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.sun.jersey.api.client.Client.<init>(Client.java:188)
        at com.sun.jersey.api.client.Client.<init>(Client.java:171)
        at com.sun.jersey.api.client.Client.create(Client.java:683)
        at 
org.apache.ranger.plugin.util.RangerRESTClient.buildClient(RangerRESTClient.java:228)
        at 
org.apache.ranger.plugin.util.RangerRESTClient.getClient(RangerRESTClient.java:193)
        at 
org.apache.ranger.plugin.util.RangerRESTClient.get(RangerRESTClient.java:473)
        at 
org.apache.ranger.admin.client.RangerAdminRESTClient.getRangerRolesDownloadResponse(RangerAdminRESTClient.java:1340)
        at 
org.apache.ranger.admin.client.RangerAdminRESTClient.getRolesIfUpdatedWithCred(RangerAdminRESTClient.java:1202)
        at 
org.apache.ranger.admin.client.RangerAdminRESTClient.getRolesIfUpdated(RangerAdminRESTClient.java:167)
        at 
org.apache.ranger.plugin.util.RangerRolesProvider.loadUserGroupRolesFromAdmin(RangerRolesProvider.java:183)
        at 
org.apache.ranger.plugin.util.RangerRolesProvider.loadUserGroupRoles(RangerRolesProvider.java:123)
        at 
org.apache.ranger.plugin.util.PolicyRefresher.loadRoles(PolicyRefresher.java:495)
        at 
org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:144)
        at 
org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:245)
        at 
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor.start(RangerAuthorizationCoprocessor.java:1120)
        at 
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor.start(RangerAuthorizationCoprocessor.java:160)
        at 
org.apache.hadoop.hbase.coprocessor.BaseEnvironment.startup(BaseEnvironment.java:69)
        at 
org.apache.hadoop.hbase.coprocessor.CoprocessorHost.checkAndLoadInstance(CoprocessorHost.java:285)
        at 
org.apache.hadoop.hbase.coprocessor.CoprocessorHost.loadSystemCoprocessors(CoprocessorHost.java:171)
        at 
org.apache.hadoop.hbase.master.MasterCoprocessorHost.<init>(MasterCoprocessorHost.java:155)
        at 
org.apache.hadoop.hbase.master.HMaster.initializeCoprocessorHost(HMaster.java:3870)
        at 
org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:902)
        at 
org.apache.hadoop.hbase.master.HMaster.startActiveMasterManager(HMaster.java:2175)
        at org.apache.hadoop.hbase.master.HMaster.lambda$run$0(HMaster.java:520)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: 
org.glassfish.jersey.internal.RuntimeDelegateImpl
        at 
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:130)
        at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:97)
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:172)
        at com.sun.jersey.core.header.MediaTypes.<clinit>(MediaTypes.java:65)
        ... 33 more
Caused by: java.lang.ClassNotFoundException: 
org.glassfish.jersey.internal.RuntimeDelegateImpl
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:87)
        at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:185)
        at 
javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:112)
        ... 36 more
 {code}
 

The HBase library depends on the javax.ws.rs-api-2.1.1.jar which loads the 
org.glassfish.jersey.internal.RuntimeDelegateImpl class. However, this class is 
only available in the Jersey 2 library. Therefore, when the HBase Ranger plugin 
includes the jersey-client and jersey-core 1.x libraries, it pollutes the HBase 
RuntimeDelegate loading.

 

This issue is described in the HBase issue tracker: 
https://issues.apache.org/jira/browse/HBASE-22052

 

To reproduce this issue, install the HBase Ranger plugins for Ranger 2.4 on 
HBase 2.x and enable the Ranger plugin by adding the following configuration 
properties: hbase.coprocessor.master.classes 
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor

hbase.coprocessor.region.classes  
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor

hbase.coprocessor.regionserver.classes 
org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor Then, 
restart the HBase cluster.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to