How to use Jersey 2.x with Hadoop

Asked by At

I am trying to call a Rest Service using Jersey 2.6 from hadoop mapper. However looks like Hadoop yarn uses Jersey 1.9 which is in the classpath, causing my application to fail (java.lang.NoSuchMethodError: javax.ws.rs.core.MultivaluedMap.addAll).

Is there any way to use Jersey 2.6 for my code, also have version 1.9 for hadoop yarn?

I have tried using relocating javax.rs package to a new location shadow.javax.rs using gradle shadow, however that didn't work.

0 Answers