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!/javax/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/RuntimeDelegate.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>(RenderedImageProvider.java:69)

  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

  at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

  at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.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(ComponentConstructor.java:192)

  at 
com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:179)

  at 
com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)

  at 
com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)

  at 
com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)

  at 
com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)

  at 
com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.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(RangerRESTClient.java:210)

  at 
org.apache.ranger.plugin.util.RangerRESTClient.getClient(RangerRESTClient.java:175)

  at 
org.apache.ranger.plugin.util.RangerRESTClient.getResource(RangerRESTClient.java:155)

  at 
org.apache.ranger.admin.client.RangerAdminRESTClient.createWebResource(RangerAdminRESTClient.java:279)

  at 
org.apache.ranger.admin.client.RangerAdminRESTClient.access$300(RangerAdminRESTClient.java:48)

  at 
org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminRESTClient.java:117)

  at 
org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminRESTClient.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.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:125)

  at 
org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:264)

  at 
org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:202)

  at 
org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:149)

  at 
org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:157)

  at 
org.apache.ranger.authorization.hive.authorizer.RangerHivePlugin.init(RangerHiveAuthorizer.java:1691)

  at 
org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizer.<init>(RangerHiveAuthorizer.java:114)

  at 
org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory.createHiveAuthorizer(RangerHiveAuthorizerFactory.java:37)

  at 
org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory.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(SessionState.java:1391)

  at 
org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:211)

  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

  at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

  at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

  at 
org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.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(HiveExternalCatalog.scala:66)

  at 
org.apache.spark.sql.hive.HiveExternalCatalog.client(HiveExternalCatalog.scala:65)

  at 
org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply$mcZ$sp(HiveExternalCatalog.scala:194)

  at 
org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)

  at 
org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)

  at 
org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:97)

  ... 63 more

 

Reply via email to