eclipse-lyo / lyo.client

Lyo project repository (lyo.client)
11 stars 16 forks source link

json-ld support fails if server also includes the OSLC client library #85

Closed jadelkhoury closed 4 years ago

jadelkhoury commented 4 years ago

I have an adaptor that also includes the latest oslc-client library oslc4j-client (the one for jax-rs 2.0).

If I do a GET JSON-LD, I will get the exception below! Why? As soon as I include the oslc4j-client library, I end up using the Apache httpclient version 4.0 (due to the old oauth library). Without oslc4j-client, I use the needed httpclient version 4.5.10.

Dependency Hierarchy for an adaptor without oslc4j-client

withoutOSLCClient

Dependency Hierarchy for an adaptor with oslc4j-client

withOSLCClient

Exception

javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/http/client/RedirectStrategy
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:168)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:505)
jadelkhoury commented 4 years ago

@jamsden @berezovskyi I need your help with maven here. We will have this problem if we want to have both oauth and JSON-lD at the same time.

I can solve the problem by directly adding the httpclient 4.5.10 dependency to the adaptor. But that is of course not a good solution.

Can we somehow limit the use of the 4.0 library to oauth library?

jadelkhoury commented 4 years ago

This issue can be solved by changes in the Lyo-client. See https://github.com/eclipse/lyo.client/pull/84