eclipse-ee4j / eclipse-ee4j/jersey
OSGI - Provider for jakarta.ws.rs.client.ClientBuilder cannot be found
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
We're using Jersey for several years now - for the server-side as well as for the client side. Currently we migrating to v3.1.11. The server-side is working fine, but with the client we struggle: We're trying to run a JerseyClient in our equinox OSGI environment, but always get stuck with the following exception:
`java.lang.RuntimeException: java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.client.ClientBuilder cannot be found
at jakarta.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:75)
`
The actual base structure and the code is generated by the [OpenAPI Generator](https://openapi-generator.tech/docs/generators/java). Here we're using the 'jersey3' option for the library. Further, we wrap the produced code in our own OSGI-bundle, were the required bundles are as followed (everty bundle is provided by our target platform and with the previous version everthing worked fine):
- jakarta.ws.rs-api,
- jakarta.inject.jakarta.inject-api,
- jakarta.annotation-api,
- org.glassfish.jersey.core.jersey-client,
- org.glassfish.jersey.inject.jersey-hk2,
- org.glassfish.jersey.media.jersey-media-multipart,
- org.glassfish.jersey.media.jersey-media-json-jackson,
- org.glassfish.jersey.core.jersey-common,
- org.glassfish.hk2.osgi-resource-locator,
- com.fasterxml.jackson.core.jackson-core,
- com.fasterxml.jackson.core.jackson-annotations,
- com.fasterxml.jackson.core.jackson-databind,
- wrapped.org.openapitools.jackson-databind-nullable,
- com.fasterxml.jackson.datatype.jackson-datatype-jsr310,
- de.enflexit.awb.ws.client,
We tried a couple of things:
- start level adjustements of the client bundle
- hours of searching
- introduced additinal bundles as possible dependencies
- trying to path system arguments
Further, we found - beside other - the open issue [OSGi / Spifly Provider for...](https://github.com/eclipse-ee4j/jersey/issues/5834) and wonder, if there is any progress.
Overall, we're feel a little bit lost. - Any idea or advice?
Contributor guide
Research direction
Start with the ClientBuilder.newBuilder stack trace and the listed Equinox OSGi bundles, then review the related OSGi / Spifly Provider issue #5834. Done means identifying the missing provider or configuration needed for the Jersey 3.1.11 client to initialize in this bundle set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100