ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramesh Mani <rm...@hortonworks.com>
Subject Re: Jersey version for plugin ...
Date Sun, 01 Jul 2018 05:18:54 GMT
Hi Bosco,

Yes Knox uses RangerAdminJersey2RESTClient as there is difference in the
jersey bundle it uses for client.

Did you try replacing the jersey 1.9 in knox plugin impl folder with
jersey 2.22.2?

Regards,
Ramesh



On 6/30/18, 7:20 PM, "Don Bosco Durai" <bosco@apache.org> wrote:

>Seems Knox is using RangerAdminJersey2RESTClient. The configuration seems
>to be hard coded in RangerLegacyConfigBuilder.java
>
>Let me see if I can use it and get runtime working.
>
>Thanks
>
>Bosco
>
>
>On 6/30/18, 2:04 AM, "Don Bosco Durai" <bosco@apache.org> wrote:
>
>    Hi Madhan/Ramesh
>    
>     
>    
>    I am trying to test
>https://issues.apache.org/jira/browse/RANGER-2128, but getting issues
>with Jersey version. Seems Spark comes with Jersey 2.22.2, while Ranger
>1.0 is using 1.9. I remember we having similar issues with Knox. Either
>of you remember how we resolved it? I was hoping that the customer class
>loader would have taken care of the version issues, so I copied all the
>Jersey jars to ranger-hive-plugin-impl folder.
>    
>     
>    
>    Any pointers will be appreciated. From my side, I will see if I can
>compile Ranger 1.0 plugin library with Jersey 2.22.2 to resolve this
>issue.
>    
>     
>    
>    Caused by: java.lang.LinkageError: ClassCastException: attempting to
>castjar:file:/usr/hdp/2.6.3.0-235/spark2/jars/javax.ws.rs-api-2.0.1.jar!/j
>avax/ws/rs/ext/RuntimeDelegate.classtojar:file:/usr/hdp/2.6.3.0-235/spark2
>/jars/ranger-hive-plugin-impl/jersey-core-1.9.jar!/javax/ws/rs/ext/Runtime
>Delegate.class
>    
>      at 
>javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:116)
>    
>      at 
>javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
>    
>      at javax.ws.rs.core.MediaType.<clinit>(MediaType.java:44)
>    
>      at 
>com.sun.jersey.core.impl.provider.entity.RenderedImageProvider.<clinit>(Re
>nderedImageProvider.java:69)
>    
>      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>Method)
>    
>      at 
>sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcc
>essorImpl.java:62)
>    
>      at 
>sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstr
>uctorAccessorImpl.java:45)
>    
>      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>    
>      at java.lang.Class.newInstance(Class.java:442)
>    
>      at 
>com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(Compon
>entConstructor.java:192)
>    
>      at 
>com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(Compone
>ntConstructor.java:179)
>    
>      at 
>com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(P
>roviderFactory.java:166)
>    
>      at 
>com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(Pro
>viderFactory.java:137)
>    
>      at 
>com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderSe
>rvices.java:256)
>    
>      at 
>com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderSer
>vices.java:160)
>    
>      at 
>com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBody
>Factory.java:176)
>    
>      at 
>com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory
>.java:162)
>    
>      at com.sun.jersey.api.client.Client.init(Client.java:342)
>    
>      at com.sun.jersey.api.client.Client.access$000(Client.java:118)
>    
>      at com.sun.jersey.api.client.Client$1.f(Client.java:191)
>    
>      at com.sun.jersey.api.client.Client$1.f(Client.java:187)
>    
>      at 
>com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
>    
>      at com.sun.jersey.api.client.Client.<init>(Client.java:187)
>    
>      at com.sun.jersey.api.client.Client.<init>(Client.java:170)
>    
>      at com.sun.jersey.api.client.Client.create(Client.java:679)
>    
>      at 
>org.apache.ranger.plugin.util.RangerRESTClient.buildClient(RangerRESTClien
>t.java:210)
>    
>      at 
>org.apache.ranger.plugin.util.RangerRESTClient.getClient(RangerRESTClient.
>java:175)
>    
>      at 
>org.apache.ranger.plugin.util.RangerRESTClient.getResource(RangerRESTClien
>t.java:155)
>    
>      at 
>org.apache.ranger.admin.client.RangerAdminRESTClient.createWebResource(Ran
>gerAdminRESTClient.java:279)
>    
>      at 
>org.apache.ranger.admin.client.RangerAdminRESTClient.access$300(RangerAdmi
>nRESTClient.java:48)
>    
>      at 
>org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminREST
>Client.java:117)
>    
>      at 
>org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminREST
>Client.java:115)
>    
>      at java.security.AccessController.doPrivileged(Native Method)
>    
>      at javax.security.auth.Subject.doAs(Subject.java:360)
>    
>      at 
>org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.
>java:1846)
>    
>      at 
>org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfU
>pdated(RangerAdminRESTClient.java:125)
>    
>      at 
>org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(Po
>licyRefresher.java:264)
>    
>      at 
>org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.j
>ava:202)
>    
>      at 
>org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresh
>er.java:149)
>    
>      at 
>org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.ja
>va:157)
>    
>      at 
>org.apache.ranger.authorization.hive.authorizer.RangerHivePlugin.init(Rang
>erHiveAuthorizer.java:1691)
>    
>      at 
>org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizer.<init
>>(RangerHiveAuthorizer.java:114)
>    
>      at 
>org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactor
>y.createHiveAuthorizer(RangerHiveAuthorizerFactory.java:37)
>    
>      at 
>org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactor
>y.createHiveAuthorizer(RangerHiveAuthorizerFactory.java:101)
>    
>      at 
>org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java
>:734)
>    
>      at 
>org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionSta
>te.java:1391)
>    
>      at 
>org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scal
>a:211)
>    
>      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>Method)
>    
>      at 
>sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcc
>essorImpl.java:62)
>    
>      at 
>sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstr
>uctorAccessorImpl.java:45)
>    
>      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>    
>      at 
>org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(Isolate
>dClientLoader.scala:268)
>    
>      at 
>org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:
>362)
>    
>      at 
>org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:
>266)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog.client$lzycompute(HiveExtern
>alCatalog.scala:66)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog.client(HiveExternalCatalog.s
>cala:65)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.ap
>ply$mcZ$sp(HiveExternalCatalog.scala:194)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.ap
>ply(HiveExternalCatalog.scala:194)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.ap
>ply(HiveExternalCatalog.scala:194)
>    
>      at 
>org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatal
>og.scala:97)
>    
>      ... 63 more
>    
>     
>    
>    
>
>


Mime
View raw message