mavenjerseyjax-rspostmark

Is there a version of postmark java client library which uses jersey 1.x instead of 2.x?


I have a RESTful web service application in java deployed on google app-engine which uses jersey 1.18.6. I want to use postmark java client to send transactional emails from it. When I integrated it, i was seeing the following exception:

javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family

From what I could find, I think this error was because of there were two different (and probably incompatible) version of jersey being used ,1.18.6 for jersey-server, jersey-guice and jersey-bundle and 2.25.1 for jersey-client (by postmark).

Then I tried to make the jersey version 1.18,6 throughout, so in the my main project pom, while including the dependency for postmark, I excluded the jersey-client (by added exclusions header) and separately added jersey-client dependency in my main project .

But then I got the following error:

java.lang.NoClassDefFoundError: javax/ws/rs/core/MultivaluedHashMap

This is I think the class MultivaluedHashMap is present only in jax-rs 2.x versions (which is compatible with jersey 2.x versions)

So my questions are:

  1. Is there a version of postmark java client library which uses jersey 1.x instead of jersey 2.x?

  2. If no then what options do I have other than migrating my main project from jersey 1.x to jersey 2.x. I don't want to do that since we will have to migrate not just the jersey dependencies but I think some other things like guice, shiro etc. which would be time consuming. Also it doesn't really seem optimal to modify multiple existing dependencies just to include one additional module.


Solution

  • There isn't. The very first commit of the project's pom.xml already used Jersey 2.25.1