Maybe build Spark with -Djersey.version=2.9 ? Cheers
On Tue, Oct 6, 2015 at 5:57 AM, oggie <gog...@gmail.com> wrote: > I have some jersey compatibility issues when I tried to upgrade from 1.3.1 > to > 1.4.1.. > > We have a Java app written with spark 1.3.1. That app also uses Jersey 2.9 > client to make external calls. We see spark 1.4.1 uses Jersey 1.9. > > In 1.3.1 we were able to add some exclusions to our pom and everything > worked fine. But now it seems there's extra logic in Spark that now needs > those exclusions. If I remove the exclusions, then our code that uses > Jersey2 fails. I don't really want to downgrade our code to Jersey1 though. > > The error is: > > java.lang.NoClassDefFoundError: > com/sun/jersey/spi/container/servlet/ServletContainer > ... > at > > org.apache.spark.status.api.v1.ApiRootResource$.getServletHandler(ApiRootResource.scala:174) > > > Is there anything that can be done in the pom to fix this? Here's what we > have right now in our pom: > <dependency> > <groupId>org.apache.spark</groupId> > <artifactId>spark-core_2.10</artifactId> > <version>1.4.1</version> > <exclusions> > <exclusion> > <groupId>com.sun.jersey</groupId> > <artifactId>jersey-core</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey</groupId> > <artifactId>jersey-client</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey</groupId> > <artifactId>jersey-server</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey</groupId> > <artifactId>jersey-json</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey.contribs</groupId> > <artifactId>jersey-guice</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey</groupId> > <artifactId>jersey-grizzly2</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey.jersey-test-framework</groupId> > <artifactId>jersey-test-framework-core</artifactId> > </exclusion> > <exclusion> > <groupId>com.sun.jersey.jersey-test-framework</groupId> > <artifactId>jersey-test-framework-grizzly2</artifactId> > </exclusion> > </exclusions> > <scope>provided</scope> > </dependency> > > > <dependency> > <groupId>org.apache.spark</groupId> > <artifactId>spark-streaming_2.10</artifactId> > <version>1.4.1</version> > <scope>provided</scope> > </dependency> > <dependency> > <groupId>org.apache.spark</groupId> > <artifactId>spark-sql_2.10</artifactId> > <version>1.4.1</version> > <scope>provided</scope> > </dependency> > <dependency> > <groupId>org.glassfish.jersey.core</groupId> > <artifactId>jersey-client</artifactId> > <version>2.9</version> > </dependency> > > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/compatibility-issue-with-Jersey2-tp24951.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >