You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by "Ralph Bergmann | the4thFloor.eu" <ra...@the4thfloor.eu> on 2015/02/18 01:14:03 UTC

spark-core in a servlet

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             ralph@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

Re: spark-core in a servlet

Posted by Arush Kharbanda <ar...@sigmoidanalytics.com>.
I am not sure if this could be causing the issue but spark  is compatible
with scala 2.10.
Instead of spark-core_2.11 you might want to try spark-core_2.10

On Wed, Feb 18, 2015 at 5:44 AM, Ralph Bergmann | the4thFloor.eu <
ralph@the4thfloor.eu> wrote:

> 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             ralph@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
>



-- 

[image: Sigmoid Analytics] <http://htmlsig.com/www.sigmoidanalytics.com>

*Arush Kharbanda* || Technical Teamlead

arush@sigmoidanalytics.com || www.sigmoidanalytics.com

RE: spark-core in a servlet

Posted by Anton Brazhnyk <an...@genesys.com>.
Check for the dependencies. Looks like you have a conflict around servlet-api jars.
Maven's dependency-tree, some exclusions and some luck :) could help.

________________________________________
From: Ralph Bergmann | the4thFloor.eu [ralph@the4thfloor.eu]
Sent: Tuesday, February 17, 2015 4:14 PM
To: user@spark.apache.org
Subject: spark-core in a servlet

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             ralph@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



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