You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Felix Cheung (JIRA)" <ji...@apache.org> on 2017/05/20 03:52:04 UTC

[jira] [Commented] (SPARK-20815) NullPointerException in RPackageUtils#checkManifestForR

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

Felix Cheung commented on SPARK-20815:
--------------------------------------

make sense to me. would you like to contribute the fix?


> NullPointerException in RPackageUtils#checkManifestForR
> -------------------------------------------------------
>
>                 Key: SPARK-20815
>                 URL: https://issues.apache.org/jira/browse/SPARK-20815
>             Project: Spark
>          Issue Type: Bug
>          Components: SparkR
>    Affects Versions: 2.1.1
>            Reporter: Andrew Ash
>
> Some jars don't have manifest files in them, such as in my case javax.inject-1.jar and value-2.2.1-annotations.jar
> This causes the below NPE:
> {noformat}
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.spark.deploy.RPackageUtils$.checkManifestForR(RPackageUtils.scala:95)
>         at org.apache.spark.deploy.RPackageUtils$$anonfun$checkAndBuildRPackage$1$$anonfun$apply$1.apply$mcV$sp(RPackageUtils.scala:180)
>         at org.apache.spark.deploy.RPackageUtils$$anonfun$checkAndBuildRPackage$1$$anonfun$apply$1.apply(RPackageUtils.scala:180)
>         at org.apache.spark.deploy.RPackageUtils$$anonfun$checkAndBuildRPackage$1$$anonfun$apply$1.apply(RPackageUtils.scala:180)
>         at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1322)
>         at org.apache.spark.deploy.RPackageUtils$$anonfun$checkAndBuildRPackage$1.apply(RPackageUtils.scala:202)
>         at org.apache.spark.deploy.RPackageUtils$$anonfun$checkAndBuildRPackage$1.apply(RPackageUtils.scala:175)
>         at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
>         at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
>         at org.apache.spark.deploy.RPackageUtils$.checkAndBuildRPackage(RPackageUtils.scala:175)
>         at org.apache.spark.deploy.SparkSubmit$.prepareSubmitEnvironment(SparkSubmit.scala:311)
>         at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:152)
>         at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:118)
>         at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
> {noformat}
> due to RPackageUtils#checkManifestForR assuming {{jar.getManifest}} is non-null.
> However per the JDK spec it can be null:
> {noformat}
>     /**
>      * Returns the jar file manifest, or <code>null</code> if none.
>      *
>      * @return the jar file manifest, or <code>null</code> if none
>      *
>      * @throws IllegalStateException
>      *         may be thrown if the jar file has been closed
>      * @throws IOException  if an I/O error has occurred
>      */
>     public Manifest getManifest() throws IOException {
>         return getManifestFromReference();
>     }
> {noformat}
> This method should do a null check and return false if the manifest is null (meaning no R code in that jar)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org