Hi,

I want to use spark-core inside of a HttpServlet. I use Maven for the
build task but I have a dependency problem :-(

I get this error message:

ClassCastException:
com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer
cannot be cast to javax.servlet.ServletContainerInitializer

When I add this exclusions it builds but than there are other classes
not found at runtime:

      <dependency>
         <groupId>org.apache.spark</groupId>
         <artifactId>spark-core_2.11</artifactId>
         <version>1.2.1</version>
         <exclusions>
            <exclusion>
               <groupId>org.apache.hadoop</groupId>
               <artifactId>hadoop-client</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.eclipse.jetty</groupId>
               <artifactId>*</artifactId>
            </exclusion>
         </exclusions>
      </dependency>


What can I do?


Thanks a lot!,

Ralph

-- 

Ralph Bergmann

iOS and Android app developer


www              http://www.the4thFloor.eu

mail             ra...@the4thfloor.eu
skype            dasralph

google+          https://plus.google.com/+RalphBergmann
xing             https://www.xing.com/profile/Ralph_Bergmann3
linkedin         https://www.linkedin.com/in/ralphbergmann
gulp             https://www.gulp.de/Profil/RalphBergmann.html
github           https://github.com/the4thfloor


pgp key id       0x421F9B78
pgp fingerprint  CEE3 7AE9 07BE 98DF CD5A E69C F131 4A8E 421F 9B78
<project
   xmlns="http://maven.apache.org/POM/4.0.0";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>

   <name>SparkWordCount</name>
   <version>1.0-SNAPSHOT</version>
   <groupId>eu.the4thfloor</groupId>
   <artifactId>SparkWordCount</artifactId>
   <packaging>war</packaging>
   <url>http://maven.apache.org</url>

   <properties>
      <jdk.version>1.7</jdk.version>
   </properties>

   <dependencies>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.11</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
         <version>3.1.0</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.spark</groupId>
         <artifactId>spark-core_2.11</artifactId>
         <version>1.2.1</version>
         <exclusions>
            <exclusion>
               <groupId>org.apache.hadoop</groupId>
               <artifactId>hadoop-client</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.eclipse.jetty</groupId>
               <artifactId>*</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
   </dependencies>

   <build>
      <finalName>SparkWordCount</finalName>
      <plugins>
         <!-- Eclipse project -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
               <!-- Always download and attach dependencies source code -->
               <downloadSources>true</downloadSources>
               <downloadJavadocs>false</downloadJavadocs>
               <!-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 -->
               <wtpversion>2.0</wtpversion>
            </configuration>
         </plugin>
         <!-- Set JDK Compiler Level -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
               <source>${jdk.version}</source>
               <target>${jdk.version}</target>
            </configuration>
         </plugin>
         <!-- For Maven Tomcat Plugin -->
         <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
               <path>/SparkWordCount</path>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to