0

I have a Jersey-2 based web service with a dependency on Hadoop-HDFS. Hadoop-HDFS, itself has a dependency on Jersey-1. A conflict is arising as bother jerseys define javax.ws.rs.core.Application. On my local machine, things "work" because Jersey2 is first in the classpath, but when I deploy to another machine, things break because Jersey-1 is first. It would be great if Jetty had a way to give precedence to Jersey-2, but my research turned up no options for doing this. Is there a way?

I cannot exclude the transitive Jersey-1 dependency outright, as it breaks the hadoop client.

Joe Abrams
  • 1,124
  • 11
  • 16
  • You could try to exclude just the 1.x spec from [javax.ws.rs/jsr311-api](https://mvnrepository.com/artifact/javax.ws.rs/jsr311-api) because the 2.x spec from [javax.ws.rs/javax.ws.rs-api](https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api) should be (mostly?) a superset and sufficient. Those 2 should be the ones providing the conflicting classes (unless early version of jersey2 according to http://stackoverflow.com/questions/32106428/jaxrs-api-vs-jsr311-api-vs-javax-ws-rs-api-vs-jersey-core ) – zapl Oct 31 '16 at 23:04
  • I tried to exclude the 1.x spec but got more runtime errors upon instantiating an HDFS FileSystem for reading from. I concluded this couldn't be done reliably and split my Jetty service in two, since class-paths aren't shared. – Joe Abrams Nov 07 '16 at 23:52

0 Answers0