Github user mccheah commented on the pull request:
https://github.com/apache/spark/pull/9615#issuecomment-157585464
So I tried the following experiment to simulate what we want to be doing
and testing the hypothesis that it doesn't matter what order the Jersey jars
are loaded in. What I did was, take all of the jersey 1 jars in my
application's classpath, and remove the META-INF/services/javax.ws.* files from
them. I also renamed my jersey-1 jars, prefixing them with 1-jersey-*.
I started my application and on the driver side I created a
javax.ws.rs.NotFoundException, and hit this error:
```
Caused by: java.lang.NoSuchMethodError:
javax.ws.rs.ClientErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status$Family;)Ljavax/w
at
javax.ws.rs.ClientErrorException.<init>(ClientErrorException.java:64)
~[javax.ws.rs-api-2.0.1.jar:2.0.1]
at javax.ws.rs.NotFoundException.<init>(NotFoundException.java:60)
~[javax.ws.rs-api-2.0.1.jar:2.0.1]
at
com.palantir.datatable.spark.SparkContextManager.createSparkConf(SparkContextManager.java:531)
~[data-table-core-0.46.0-dev.36+g9606077.dirty.jar:na]
at
com.palantir.datatable.spark.SparkContextManager.<init>(SparkContextManager.java:142)
~[data-table-core-0.46.0-dev.36+g9606077.dirty.jar:na]
```
javax.ws.rs.NotFoundException is a class in the Jersey 2 jar, but it
extends javax.ws.rs.ClientErrorException... which in turn extends
javax.ws.rs.WebApplicationException. The ClientErrorException and
WebApplicationException classes exist in both Jersey jars but are different. In
particular, WebApplicationException in the Jersey 2 jar contains the validate()
method and that method is absent in Jersey 1. WebApplicationException was
loaded from Jersey 1 and so it is missing the validate() method that
ClientErrorException tries to call.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]