Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot and apache spark - container conflict

I am trying to use spring boot 1.1.5 and apache spark 1.0.2 together in project. Look like apache spark uses Jetty container internally and I have configured spring-boot to use Tomcat container. However application startup fails with some securityException at root cause. If I see full stack trace looks like spring boot trying to initialize "jettyEmbeddedServletContainerFactory" which it shouldn't in first place. It probably picks it up from classpath due to jetty presence via spark. If I exclude jetty from spark and run again I don't see same error again but then SparkContext initialization fails due to not finding jetty. How do i tell spring-boot runtime to look for "TomcatEmbeddedServletContainerFactory" instead of jetty one?

like image 658
nir Avatar asked Dec 14 '22 16:12

nir


1 Answers

I got "java.lang.SecurityException: class "javax.servlet.http.HttpSessionIdListener"'s signer information does not match signer information of other classes in the same package"

To fix this issue I was need to remove all javax.servlet dependencies.

<dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-core_2.10</artifactId>
        <version>1.3.1</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.glassfish</groupId>
                <artifactId>javax.servlet</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.eclipse.jetty.orbit</groupId>
                <artifactId>javax.servlet</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
like image 131
Denis Shelukhanov Avatar answered Jan 05 '23 20:01

Denis Shelukhanov