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

Kishore K commented on SPARK-17688:
-----------------------------------

Sean Owen - Thanks for responding. 
Below is my application pom.xml file snapshot, I'm trying to configure spark 
using maven. Please let me know if I'm doing it right. Appreciate your help !

        <dependencies>
                <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                        <version>1.7.13</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.spark</groupId>
                        <artifactId>spark-core_2.11</artifactId>
                        <version>2.0.0</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.spark</groupId>
                        <artifactId>spark-sql_2.11</artifactId>
                        <version>2.0.0</version>
                </dependency>
                <!-- JETTY DEPENDENCIES -->
                <dependency> <!-- Jetty dependency -->
                        <groupId>org.eclipse.jetty.websocket</groupId>
                        <artifactId>javax-websocket-server-impl</artifactId>
                        <version>9.2.7.v20150116</version>
                </dependency>
                <dependency>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-server</artifactId>
                        <version>${jetty.version}</version>
                </dependency>

                <dependency>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-webapp</artifactId>
                        <version>${jetty.version}</version>
                </dependency>

                <dependency>
                        <groupId>org.eclipse.jetty.websocket</groupId>
                        <artifactId>websocket-server</artifactId>
                        <version>${jetty.version}</version>
                </dependency>
                <dependency>
                        <groupId>org.eclipse.jetty.websocket</groupId>
                        <artifactId>websocket-servlet</artifactId>
                        <version>${jetty.version}</version>
                </dependency>
        </dependencies>
<build>
                <plugins>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>3.3</version>
                                <configuration>
                                        <source>1.8</source>
                                        <target>1.8</target>
                                </configuration>
                        </plugin>
                </plugins>
        </build>

> xception in thread "main" java.lang.NoSuchMethodError: 
> javax.servlet.ServletContext.getInitParameter(Ljava/lang/String;)Ljava/lang/String;
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-17688
>                 URL: https://issues.apache.org/jira/browse/SPARK-17688
>             Project: Spark
>          Issue Type: Question
>          Components: Java API
>    Affects Versions: 2.0.0
>            Reporter: Kishore K
>            Priority: Minor
>
> SparkConf conf = new 
> SparkConf().setAppName("org.sparkexample.WordCount").setMaster("local");
>  JavaSparkContext context = new JavaSparkContext(conf);
> Above line of code is creating below error. Please help me resolve this
> INFO /static: org.spark_project.jetty.servlet.DefaultServlet: init
> Exception in thread "main" java.lang.NoSuchMethodError: 
> javax.servlet.ServletContext.getInitParameter(Ljava/lang/String;)Ljava/lang/String;
>       at 
> org.spark_project.jetty.servlet.DefaultServlet.getInitParameter(DefaultServlet.java:341)
>       at 
> org.spark_project.jetty.servlet.DefaultServlet.getInitBoolean(DefaultServlet.java:350)
>       at 
> org.spark_project.jetty.servlet.DefaultServlet.init(DefaultServlet.java:190)
>       at javax.servlet.GenericServlet.init(GenericServlet.java:266)
>       at 
> org.spark_project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
>       at 
> org.spark_project.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
>       at 
> org.spark_project.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
>       at 
> org.spark_project.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
>       at 
> org.spark_project.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
>       at 
> org.spark_project.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
>       at 
> org.spark_project.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
>       at 
> org.spark_project.jetty.servlets.gzip.GzipHandler.doStart(GzipHandler.java:456)
>       at 
> org.spark_project.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
>       at 
> org.spark_project.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
>       at 
> org.spark_project.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
>       at 
> org.spark_project.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
>       at org.spark_project.jetty.server.Server.start(Server.java:387)
>       at 
> org.spark_project.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
>       at 
> org.spark_project.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
>       at org.spark_project.jetty.server.Server.doStart(Server.java:354)
>       at 
> org.spark_project.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>       at 
> org.apache.spark.ui.JettyUtils$.org$apache$spark$ui$JettyUtils$$connect$1(JettyUtils.scala:298)
>       at org.apache.spark.ui.JettyUtils$$anonfun$5.apply(JettyUtils.scala:308)
>       at org.apache.spark.ui.JettyUtils$$anonfun$5.apply(JettyUtils.scala:308)
>       at 
> org.apache.spark.util.Utils$$anonfun$startServiceOnPort$1.apply$mcVI$sp(Utils.scala:2071)
>       at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
>       at org.apache.spark.util.Utils$.startServiceOnPort(Utils.scala:2062)
>       at 
> org.apache.spark.ui.JettyUtils$.startJettyServer(JettyUtils.scala:308)
>       at org.apache.spark.ui.WebUI.bind(WebUI.scala:139)
>       at 
> org.apache.spark.SparkContext$$anonfun$10.apply(SparkContext.scala:451)
>       at 
> org.apache.spark.SparkContext$$anonfun$10.apply(SparkContext.scala:451)
>       at scala.Option.foreach(Option.scala:257)
>       at org.apache.spark.SparkContext.<init>(SparkContext.scala:451)
>       at 
> org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
>       at 
> com.utc.bis.dip.addon.webctrl.weather.WordCount.main(WordCount.java:47)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to