Comments (4)
Thanks for the report @matthiaswelz. The Java client is meant to be compatible with Java8+, including Java EE 8, but also looking forward, hence the use of the newer jarkarta.json
base package.
I agree with you that Glassfish using the same class for implementations of javax.json
and jakarta.json
is a strange decision.
The context here is a bit different from that of Hibernate Validator as the purpose of elasticsearch-java is not to provide an implementation of a JEE spec and our versioning follows that of Elaticsearch versions.
I see two approaches to solving this:
- shade Glassfish (the
jakarta.json
variant) and include it in the elasticsearch-java jar file, so that it doesn't conflict with thejavax.json
variant from Java EE 8 - release two artifacts, one targeting
jakarta.json
and another targetingjavax.json
.
I'm leaning towards the first approach, as we can expect that jakarta.json
will evolve in the future while javax.json
will not. This will also avoid having to publish two different artifacts and asking users to make the choice between those.
from elasticsearch-java.
I have posted a workaround involving the use of the Maven shade plugin to Stackoverflow.
On the stackoverlow thread, it was suggested
Can't you just pick an Elasticsearch version suitable for your environment?
Does that mean that the elasticsearch-java client is not meant to be used with Java EE 8?
Right now, there is unfortunately no alternative to Java EE 8 for many business applications as Java EE 9 is still in preview stage for most (if not all?) application servers. Also, migrating from Java EE 8 to Java EE 9 is not trivial because Java EE 9 is not backwards compatible to Java EE 8.
For example, Hibernate Validator takes the following approach:
Jakarta EE 9 is an iterative release on top of EE 8 with the main purpose of renaming all the javax. packages to the jakarta. packages.
For a while, we will provide equivalent Hibernate Validator versions for both EE 8 and EE 9: Hibernate Validator 6.x will keep the javax. packages while Hibernate Validator 7.x moved to the jakarta. packages.
Full transition in the Java ecosystem will take months if not years given how many libraries depend on the javax. packages, thatβs why we will maintain both in parallel and why we are releasing two new versions today.*
from elasticsearch-java.
Another strange thing: The maven website for the artifact org.glassfish:jakarta.json lists version 2.0.1 as current and links to https://github.com/eclipse-ee4j/jsonp .
However, the source code in that repository does not seem to include the actual implementation and the maven coordinates are different too: jakarta.json:jakarta.json-api
.
Funnily enough, the JsonProvider
in that repository specifies the following default provider:
private static final String DEFAULT_PROVIDER = "org.eclipse.jsonp.JsonProviderImpl";
Not sure what's going on here - but it appears to me that there seem to be multiple artifacts claiming to be the "official" one. Also, I don't know which artifact provides the org.eclipse.jsonp.JsonProviderImpl
class.
Are you sure the org.glassfish:jakarta.json
is actually the "right" artifact to include to use the JSON-P API?
Maybe using jakarta.json:jakarta.json-api
together with an appropriate implementation (if existing?) would be a better alternative to shading. But also not sure if that will actually solve the issue or will introduce similar issues if one happens to have a javax.json
-version of org.eclipse.jsonp.JsonProviderImpl
on their classpath (if that exists?).
from elasticsearch-java.
@matthiaswelz I found out that Glassfish JSON-P, in its jakarta.json
variant, now exists as Eclipse Parsson.
I've updated the project dependencies in PR #63, which should solve compatibility issue with JEE8.
As a workaround until the next release, you may filter out Glassfish from Elasticsearch-Java's dependencies in your project and add Parsson as a replacement.
from elasticsearch-java.
Related Issues (20)
- I can't provide a set of synonyms when creating the analyzer HOT 7
- On the issue of termvectors queries
- Regarding termvectors query related issues HOT 1
- PutSynonymResponse: Failed to decode response HOT 2
- TermsBucketBase: doc_count_error should be doc_count_error_upper_bound HOT 1
- Read By Id: Failed to decode response
- Assign a tokenizer to a field when creating an index. 8.6.0 HOT 1
- co.elastic.clients.elasticsearch.ElasticsearchClient.delete responce nullpointerexception HOT 2
- Creating aggregation from json via supplied reader HOT 1
- Building a zero result response declares missing properties as mandatory which should be optional HOT 1
- `field_masking_span` is deprecated in ES8.0+ but still used in java client HOT 4
- Cannot parse DynamicTemplate mapping with unknown field HOT 5
- Encountering NoSuchMethodError when Creating Elasticsearch Client
- PutTemplateRequest - `Unknown field 'composed_of'` HOT 1
- Snowball token filter with default language breaks `indices.get()` HOT 1
- I can't disable the 'type#name' format in the deserialization of the response HOT 1
- New lightweight http layer based on JDK 11
- New http layer based on Apache HTTP 5.x
- Support for geo distance sort on nested fields HOT 1
- JsonpMappingException thrown when parsing explicitly null co.elastic.clients.elasticsearch._types.Script from Json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-java.