spark-submit throws: ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException










1















I am attempting to submit an app to my remote Spark 2.3.2 cluster (which I am able to access from my client machine). I keep getting ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException and I just don't understand why. I have been able to run this code locally and it works.



Any insights or pointers as to what ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException might mean would be appreciated



spark-submit --class com.mycode.example.Counter --master spark://my-remote-spark-master:7077 ./target/scala-2.11/example-hcl-spark-scala-mycodeblock.jar /users/mycode/input /users/mycode/output

...
2018-11-14 15:15:11 ERROR SparkContext:91 - Error initializing SparkContext.
java.lang.NullPointerException
at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
at com.mycode.example.Counter$.main(Counter.scala:27)
at com.mycode.example.Counter.main(Counter.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
2018-11-14 15:15:11 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint:54 - OutputCommitCoordinator stopped!
2018-11-14 15:15:11 INFO SparkContext:54 - SparkContext already stopped.
Exception in thread "main" java.lang.NullPointerException
at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
at com.mycode.example.Counter$.main(Counter.scala:27)
at com.mycode.example.Counter.main(Counter.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)2018-11-14 15:15:11 INFO SparkContext:54 - Successfully stopped SparkContext

at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Shutdown hook called
2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-91cc1f38-cb03-489f-90cb-2d65763dc0b9
2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-720b55a1-4723-42ac-87d4-befc06b0f2e4









share|improve this question


























    1















    I am attempting to submit an app to my remote Spark 2.3.2 cluster (which I am able to access from my client machine). I keep getting ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException and I just don't understand why. I have been able to run this code locally and it works.



    Any insights or pointers as to what ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException might mean would be appreciated



    spark-submit --class com.mycode.example.Counter --master spark://my-remote-spark-master:7077 ./target/scala-2.11/example-hcl-spark-scala-mycodeblock.jar /users/mycode/input /users/mycode/output

    ...
    2018-11-14 15:15:11 ERROR SparkContext:91 - Error initializing SparkContext.
    java.lang.NullPointerException
    at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
    at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
    at com.mycode.example.Counter$.main(Counter.scala:27)
    at com.mycode.example.Counter.main(Counter.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
    2018-11-14 15:15:11 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint:54 - OutputCommitCoordinator stopped!
    2018-11-14 15:15:11 INFO SparkContext:54 - SparkContext already stopped.
    Exception in thread "main" java.lang.NullPointerException
    at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
    at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
    at com.mycode.example.Counter$.main(Counter.scala:27)
    at com.mycode.example.Counter.main(Counter.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)2018-11-14 15:15:11 INFO SparkContext:54 - Successfully stopped SparkContext

    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
    2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Shutdown hook called
    2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-91cc1f38-cb03-489f-90cb-2d65763dc0b9
    2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-720b55a1-4723-42ac-87d4-befc06b0f2e4









    share|improve this question
























      1












      1








      1








      I am attempting to submit an app to my remote Spark 2.3.2 cluster (which I am able to access from my client machine). I keep getting ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException and I just don't understand why. I have been able to run this code locally and it works.



      Any insights or pointers as to what ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException might mean would be appreciated



      spark-submit --class com.mycode.example.Counter --master spark://my-remote-spark-master:7077 ./target/scala-2.11/example-hcl-spark-scala-mycodeblock.jar /users/mycode/input /users/mycode/output

      ...
      2018-11-14 15:15:11 ERROR SparkContext:91 - Error initializing SparkContext.
      java.lang.NullPointerException
      at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
      at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
      at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
      at com.mycode.example.Counter$.main(Counter.scala:27)
      at com.mycode.example.Counter.main(Counter.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      2018-11-14 15:15:11 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint:54 - OutputCommitCoordinator stopped!
      2018-11-14 15:15:11 INFO SparkContext:54 - SparkContext already stopped.
      Exception in thread "main" java.lang.NullPointerException
      at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
      at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
      at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
      at com.mycode.example.Counter$.main(Counter.scala:27)
      at com.mycode.example.Counter.main(Counter.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)2018-11-14 15:15:11 INFO SparkContext:54 - Successfully stopped SparkContext

      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Shutdown hook called
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-91cc1f38-cb03-489f-90cb-2d65763dc0b9
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-720b55a1-4723-42ac-87d4-befc06b0f2e4









      share|improve this question














      I am attempting to submit an app to my remote Spark 2.3.2 cluster (which I am able to access from my client machine). I keep getting ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException and I just don't understand why. I have been able to run this code locally and it works.



      Any insights or pointers as to what ERROR SparkContext:91 - Error initializing SparkContext. java.lang.NullPointerException might mean would be appreciated



      spark-submit --class com.mycode.example.Counter --master spark://my-remote-spark-master:7077 ./target/scala-2.11/example-hcl-spark-scala-mycodeblock.jar /users/mycode/input /users/mycode/output

      ...
      2018-11-14 15:15:11 ERROR SparkContext:91 - Error initializing SparkContext.
      java.lang.NullPointerException
      at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
      at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
      at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
      at com.mycode.example.Counter$.main(Counter.scala:27)
      at com.mycode.example.Counter.main(Counter.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      2018-11-14 15:15:11 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint:54 - OutputCommitCoordinator stopped!
      2018-11-14 15:15:11 INFO SparkContext:54 - SparkContext already stopped.
      Exception in thread "main" java.lang.NullPointerException
      at org.apache.spark.storage.BlockManagerMaster.registerBlockManager(BlockManagerMaster.scala:64)
      at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:241)
      at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
      at com.mycode.example.Counter$.main(Counter.scala:27)
      at com.mycode.example.Counter.main(Counter.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
      at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
      at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)2018-11-14 15:15:11 INFO SparkContext:54 - Successfully stopped SparkContext

      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Shutdown hook called
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-91cc1f38-cb03-489f-90cb-2d65763dc0b9
      2018-11-14 15:15:11 INFO ShutdownHookManager:54 - Deleting directory /private/var/folders/0q/8hp24_5n78q2np59_lpm10fh0000gn/T/spark-720b55a1-4723-42ac-87d4-befc06b0f2e4






      apache-spark






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 23:25









      mxmmxm

      266




      266






















          1 Answer
          1






          active

          oldest

          votes


















          0














          In my case the issue was resolved by creating HDFS/MapR-FS home directory for the user.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310281%2fspark-submit-throws-error-sparkcontext91-error-initializing-sparkcontext-ja%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            In my case the issue was resolved by creating HDFS/MapR-FS home directory for the user.






            share|improve this answer



























              0














              In my case the issue was resolved by creating HDFS/MapR-FS home directory for the user.






              share|improve this answer

























                0












                0








                0







                In my case the issue was resolved by creating HDFS/MapR-FS home directory for the user.






                share|improve this answer













                In my case the issue was resolved by creating HDFS/MapR-FS home directory for the user.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 24 at 9:44









                HazhirHazhir

                11




                11





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310281%2fspark-submit-throws-error-sparkcontext91-error-initializing-sparkcontext-ja%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto