You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/06/20 12:42:57 UTC

[GitHub] [submarine] gumartinm opened a new pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

gumartinm opened a new pull request #319:
URL: https://github.com/apache/submarine/pull/319


   ### What is this PR for?
   submarine-spark-security fails with java.lang.NoClassDefFoundError
   
   uber jar is missing submarine_spark_ranger_project/org/codehaus/jackson/jaxrs/JacksonJsonProvider
   
   ### What type of PR is it?
   [Bug Fix]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-537
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? Yes/No
   * Is there breaking changes for older versions? Yes/No
   * Does this needs documentation? Yes/No
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] gumartinm commented on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
gumartinm commented on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-647705165


   > I have checked the spark 2.4 maven dependencies
   > 
   > https://github.com/apache/spark/blob/47a73b2baac38ff2fa4e0aad63a79891bbce7cf0/dev/deps/spark-deps-hadoop-2.6#L94
   > 
   > Anything I missed?
   
   Its package is shaded because of this configuration: https://github.com/apache/submarine/blob/master/submarine-security/spark-security/pom.xml#L389
   
   If it is not included in the uber jar with its shaed package, submarine throws this exception (because it is trying to load the shaded package):
   
   `
   java.lang.NoClassDefFoundError: submarine_spark_ranger_project/org/codehaus/jackson/jaxrs/JacksonJsonProvider
   	at org.apache.ranger.plugin.util.RangerRESTClient.buildClient(RangerRESTClient.java:209)
   	at org.apache.ranger.plugin.util.RangerRESTClient.getClient(RangerRESTClient.java:176)
   	at org.apache.ranger.plugin.util.RangerRESTClient.getResource(RangerRESTClient.java:156)
   	at org.apache.ranger.admin.client.RangerAdminRESTClient.createWebResource(RangerAdminRESTClient.java:635)
   	at org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:142)
   	at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:251)
   	at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:191)
   	at org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:137)
   	at org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:229)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.init(RangerSparkPlugin.scala:43)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.<init>(RangerSparkPlugin.scala:64)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.<clinit>(RangerSparkPlugin.scala)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.org$apache$submarine$spark$security$RangerSparkAuthorizer$$getSparkResource(RangerSparkAuthorizer.scala:257)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$$anonfun$addAccessRequest$1$1.apply(RangerSparkAuthorizer.scala:75)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$$anonfun$addAccessRequest$1$1.apply(RangerSparkAuthorizer.scala:74)
   	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
   	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.addAccessRequest$1(RangerSparkAuthorizer.scala:74)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.checkPrivileges(RangerSparkAuthorizer.scala:98)
   	at org.apache.spark.sql.catalyst.optimizer.SubmarineSparkRangerAuthorizationExtension.apply(SubmarineSparkRangerAuthorizationExtension.scala:64)
   	at org.apache.spark.sql.catalyst.optimizer.SubmarineSparkRangerAuthorizationExtension.apply(SubmarineSparkRangerAuthorizationExtension.scala:39)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1$$anonfun$apply$1.apply(RuleExecutor.scala:87)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1$$anonfun$apply$1.apply(RuleExecutor.scala:84)
   	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:124)
   	at scala.collection.immutable.List.foldLeft(List.scala:84)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1.apply(RuleExecutor.scala:84)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1.apply(RuleExecutor.scala:76)
   	at scala.collection.immutable.List.foreach(List.scala:392)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:76)
   	at org.apache.spark.sql.execution.QueryExecution.optimizedPlan$lzycompute(QueryExecution.scala:67)
   	at org.apache.spark.sql.execution.QueryExecution.optimizedPlan(QueryExecution.scala:67)
   	at org.apache.spark.sql.execution.QueryExecution.sparkPlan$lzycompute(QueryExecution.scala:73)
   	at org.apache.spark.sql.execution.QueryExecution.sparkPlan(QueryExecution.scala:69)
   	at org.apache.spark.sql.execution.QueryExecution.executedPlan$lzycompute(QueryExecution.scala:78)
   	at org.apache.spark.sql.execution.QueryExecution.executedPlan(QueryExecution.scala:78)
   	at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3365)
   	at org.apache.spark.sql.Dataset.<init>(Dataset.scala:194)
   	at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:79)
   	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:642)
   	at org.apache.spark.sql.SQLContext.sql(SQLContext.scala:694)
   Caused by: java.lang.ClassNotFoundException: submarine_spark_ranger_project.org.codehaus.jackson.jaxrs.JacksonJsonProvider
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   `
   
   I guess, we have two options (not sure if there could be some other solution):
   
   **a)** We could remove this line and package would not be shaded: https://github.com/apache/submarine/blob/master/submarine-security/spark-security/pom.xml#L389
   
   **b)** Apply this PR and make `org.codehaus.jackson:jackson-jaxrs` be included in the uber jar.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] yaooqinn commented on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-648010370


   Can you also check the version of `jackson-jaxrs` for other ranger profiles?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] asfgit closed pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #319:
URL: https://github.com/apache/submarine/pull/319


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] gumartinm commented on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
gumartinm commented on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-648258236


   > Can you also check the version of `jackson-jaxrs` for other ranger profiles?
   
   Sure, this is the list that I got. All Ranger versions are using the same version, `1.9.13`
   ranger-1.0: https://github.com/apache/ranger/blob/ranger-1.0/pom.xml#L137
   ranger-1.1: https://github.com/apache/ranger/blob/ranger-1.1/pom.xml#L93
   ranger-1.2: https://github.com/apache/ranger/blob/ranger-1.2/pom.xml#L93
   ranger-2.0: https://github.com/apache/ranger/blob/ranger-2.0/pom.xml#L93
   
   And the related code:
   ranger-1.0: https://github.com/apache/ranger/blob/ranger-1.0/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-1.1: https://github.com/apache/ranger/blob/ranger-1.1/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-1.2: https://github.com/apache/ranger/blob/ranger-1.2/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-2.0: https://github.com/apache/ranger/blob/ranger-2.0/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   
   I guess, some day, Apache Ranger will stop using that old library and swith to `com.fasterxml.jackson`. No idea why they have not done it before. `org.codehaus.jackson` was deprecated long time ago: https://github.com/FasterXML/jackson-docs/wiki/Presentation-Jackson-2.0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] gumartinm edited a comment on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
gumartinm edited a comment on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-648258236


   > Can you also check the version of `jackson-jaxrs` for other ranger profiles?
   
   Sure, this is the list that I got. All Ranger versions are using the same version, `1.9.13`
   ranger-1.0: https://github.com/apache/ranger/blob/ranger-1.0/pom.xml#L137
   ranger-1.1: https://github.com/apache/ranger/blob/ranger-1.1/pom.xml#L93
   ranger-1.2: https://github.com/apache/ranger/blob/ranger-1.2/pom.xml#L93
   ranger-2.0: https://github.com/apache/ranger/blob/ranger-2.0/pom.xml#L93
   
   And the related code:
   ranger-1.0: https://github.com/apache/ranger/blob/ranger-1.0/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-1.1: https://github.com/apache/ranger/blob/ranger-1.1/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-1.2: https://github.com/apache/ranger/blob/ranger-1.2/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   ranger-2.0: https://github.com/apache/ranger/blob/ranger-2.0/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java
   
   I guess, some day, Apache Ranger will stop using that old library and switch to `com.fasterxml.jackson`. No idea why they have not done it before. `org.codehaus.jackson` was deprecated long time ago: https://github.com/FasterXML/jackson-docs/wiki/Presentation-Jackson-2.0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] jiwq commented on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
jiwq commented on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-647086342


   Thanks @gumartinm contributing. @yaooqinn Can you help to review?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] yaooqinn edited a comment on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
yaooqinn edited a comment on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-648008450


   Ah, I see, thanks for the fix then. LGTM then. I would go option b as it already applied to other dependencies.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] yaooqinn commented on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-648008450


   Ah, I see, thanks for the fix then. LGTM then.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] gumartinm edited a comment on pull request #319: SUBMARINE-537. missing JacksonJsonProvider in uber jar

Posted by GitBox <gi...@apache.org>.
gumartinm edited a comment on pull request #319:
URL: https://github.com/apache/submarine/pull/319#issuecomment-647705165


   > I have checked the spark 2.4 maven dependencies
   > 
   > https://github.com/apache/spark/blob/47a73b2baac38ff2fa4e0aad63a79891bbce7cf0/dev/deps/spark-deps-hadoop-2.6#L94
   > 
   > Anything I missed?
   
   Its package is shaded because of this configuration: https://github.com/apache/submarine/blob/master/submarine-security/spark-security/pom.xml#L389
   
   If it is not included in the uber jar with its shaded package, submarine throws this exception (because it is trying to load the shaded package):
   
   `
   java.lang.NoClassDefFoundError: submarine_spark_ranger_project/org/codehaus/jackson/jaxrs/JacksonJsonProvider
   	at org.apache.ranger.plugin.util.RangerRESTClient.buildClient(RangerRESTClient.java:209)
   	at org.apache.ranger.plugin.util.RangerRESTClient.getClient(RangerRESTClient.java:176)
   	at org.apache.ranger.plugin.util.RangerRESTClient.getResource(RangerRESTClient.java:156)
   	at org.apache.ranger.admin.client.RangerAdminRESTClient.createWebResource(RangerAdminRESTClient.java:635)
   	at org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:142)
   	at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:251)
   	at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:191)
   	at org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:137)
   	at org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:229)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.init(RangerSparkPlugin.scala:43)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.<init>(RangerSparkPlugin.scala:64)
   	at org.apache.submarine.spark.security.RangerSparkPlugin$.<clinit>(RangerSparkPlugin.scala)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.org$apache$submarine$spark$security$RangerSparkAuthorizer$$getSparkResource(RangerSparkAuthorizer.scala:257)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$$anonfun$addAccessRequest$1$1.apply(RangerSparkAuthorizer.scala:75)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$$anonfun$addAccessRequest$1$1.apply(RangerSparkAuthorizer.scala:74)
   	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
   	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.addAccessRequest$1(RangerSparkAuthorizer.scala:74)
   	at org.apache.submarine.spark.security.RangerSparkAuthorizer$.checkPrivileges(RangerSparkAuthorizer.scala:98)
   	at org.apache.spark.sql.catalyst.optimizer.SubmarineSparkRangerAuthorizationExtension.apply(SubmarineSparkRangerAuthorizationExtension.scala:64)
   	at org.apache.spark.sql.catalyst.optimizer.SubmarineSparkRangerAuthorizationExtension.apply(SubmarineSparkRangerAuthorizationExtension.scala:39)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1$$anonfun$apply$1.apply(RuleExecutor.scala:87)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1$$anonfun$apply$1.apply(RuleExecutor.scala:84)
   	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:124)
   	at scala.collection.immutable.List.foldLeft(List.scala:84)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1.apply(RuleExecutor.scala:84)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor$$anonfun$execute$1.apply(RuleExecutor.scala:76)
   	at scala.collection.immutable.List.foreach(List.scala:392)
   	at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:76)
   	at org.apache.spark.sql.execution.QueryExecution.optimizedPlan$lzycompute(QueryExecution.scala:67)
   	at org.apache.spark.sql.execution.QueryExecution.optimizedPlan(QueryExecution.scala:67)
   	at org.apache.spark.sql.execution.QueryExecution.sparkPlan$lzycompute(QueryExecution.scala:73)
   	at org.apache.spark.sql.execution.QueryExecution.sparkPlan(QueryExecution.scala:69)
   	at org.apache.spark.sql.execution.QueryExecution.executedPlan$lzycompute(QueryExecution.scala:78)
   	at org.apache.spark.sql.execution.QueryExecution.executedPlan(QueryExecution.scala:78)
   	at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3365)
   	at org.apache.spark.sql.Dataset.<init>(Dataset.scala:194)
   	at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:79)
   	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:642)
   	at org.apache.spark.sql.SQLContext.sql(SQLContext.scala:694)
   Caused by: java.lang.ClassNotFoundException: submarine_spark_ranger_project.org.codehaus.jackson.jaxrs.JacksonJsonProvider
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   `
   
   I guess, we have two options (not sure if there could be some other solution):
   
   **a)** We could remove this line and package would not be shaded: https://github.com/apache/submarine/blob/master/submarine-security/spark-security/pom.xml#L389
   
   **b)** Apply this PR and make `org.codehaus.jackson:jackson-jaxrs` be included in the uber jar.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org