2

I'm implementing a dropwizard server app on top of an existing project. building with maven.

I'm currently in jar hell, and it's not fun. I have a pom file that's rather convoluted. I have a big problem with jersey dependencies packaged with hadoop/glassfish/com.sun. com.sun.jersey:jersey-core:jar1.19 is conflicting with org.glassfish.jersey.core:jersey-client:jar:2.22.2. I tried adding some exclusions to make it use the 2.22.x version, but it's still giving me the error seen here. I've been combing through the dependency tree and adding exclusions where I see fit, but can't seem to get it right. Here is my pom file.

DJ2
  • 1,721
  • 3
  • 34
  • 74

2 Answers2

1

Personal experience tells me that you should check ALL your dependencies (especially the ones you developed in-house) if you have the old jersey version as a dependency in there.

That's what solved a similiar problem for me.

Markus Mauksch
  • 397
  • 1
  • 9
  • 2
    `mvn dependency:list | grep jersey` will spit out the dependencies pulling in jersey. Hadoop was using an old version of jersey that I then excluded in the pom file that resolved the issue. – DJ2 Feb 14 '18 at 15:50
1

If you do :

mvn dependency:list -Dverbose (grep for filtering results)

it gives u the list of dependencies(transitive ones also).Check the version of sun jersey or glassfish jersey that's being used in your application.

If you do :

mvn dependency:tree -Dverbose -Dincludes=jersey-server

you will see the graph of where any version of jersey-server is coming from a parent.

I had a hadoop-client and an in-house rest-bus-client using a version of sun jersey(1.9.x) which i needed to remove. I tried in maven and it simply worked.

Also, this jersey version unmatch caused the following issue for me in dropwizard.

java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;

Mukul Anand
  • 606
  • 6
  • 24