Re: [osgi-dev] OSGi Http Client Missing Requirement

2019-01-21 Thread Raymond Auge via osgi-dev
On Mon, Jan 21, 2019 at 9:47 PM Paul F Fraser via osgi-dev <
osgi-dev@mail.osgi.org> wrote:

> On 21/01/2019 7:57 pm, Tim Ward wrote:
>
> As a separate question - is there a reason that you are trying to use the 
> Apache HttpClient? OSGi enRoute makes use of the JAX-RS Whiteboard which 
> includes a simple way to access the JAX-RS specification client 
> implementation. If it’s possible for you to use the existing JAX-RS Client 
> instead then you could avoid adding the duplicate function.
>
> R7 spec sample code
>
> Client client = clientBuilder.build(); Promise p =
> client.target(REST_SERVICE_URL) .path("/foo") .path("/{name}")
> .resolveTemplate("name", buzz) .request() .rx(PromiseRxInvoker.class)
> .get(String.class);
>
> Using
>
> Client client = ClientBuilder.newClient(); // as the first line
>
_clientBuilder_ is a reference to the `javax.ws.rs.client.ClientBuilder`
*service* provided by JAXRS Whiteboard, which you can get to satisfy the
above code example with:

@Reference
private ClientBuilder clientBuilder;

I cannot find dependecies which satisfy the rx(Promise...) line.
>

https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#org.osgi.service.jaxrs.client.PromiseRxInvoker

So:


  org.osgi
  org.osgi.service.jaxrs
  1.0.0


import org.osgi.service.jaxrs.client.PromiseRxInvoker;

HTH
- Ray

I have tried most of the glassfish jersey bundles and quite a few others.
>
> Is there any working code examples available or can anyone suggest the
> required dependencies?
>
> Paul
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi Http Client Missing Requirement

2019-01-21 Thread Paul F Fraser via osgi-dev

On 21/01/2019 7:57 pm, Tim Ward wrote:

As a separate question - is there a reason that you are trying to use the 
Apache HttpClient? OSGi enRoute makes use of the JAX-RS Whiteboard which 
includes a simple way to access the JAX-RS specification client implementation. 
If it’s possible for you to use the existing JAX-RS Client instead then you 
could avoid adding the duplicate function.


R7 spec sample code

Client client = clientBuilder.build(); Promise p = client.target(REST_SERVICE_URL) 
.path("/foo") .path("/{name}") .resolveTemplate("name", buzz) .request() .rx(PromiseRxInvoker.class) 
.get(String.class);


Using

Client client = ClientBuilder.newClient(); // as the first line

I cannot find dependecies which satisfy the rx(Promise...) line.

I have tried most of the glassfish jersey bundles and quite a few others.

Is there any working code examples available or can anyone suggest the required 
dependencies?

Paul

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi Http Client Missing Requirement

2019-01-21 Thread Tim Ward via osgi-dev
Hi Paul,

This is a different problem, in that where the previous requirement for the 
“osgi.service” namespace was an “active” time requirement (and therefore not 
enforced at runtime), this is a resolve time requirement that *will* prevent 
your bundles from resolving/starting in the framework. It is also the case that 
osgi.wiring.package namespace corresponds to the Import-Package part of your 
bundle manifest - your bundle uses types from the org.apache.http package and 
so you need to deploy a bundle which contains and exports that package. This is 
therefore not so much a small packaging bug, but either a significant 
dependency graph issue (the right bundle doesn’t end up in your index when it 
should) or a significant design issue (a core part of the API isn’t exported) 
in the HttpClient project.

As a separate question - is there a reason that you are trying to use the 
Apache HttpClient? OSGi enRoute makes use of the JAX-RS Whiteboard which 
includes a simple way to access the JAX-RS specification client implementation. 
If it’s possible for you to use the existing JAX-RS Client instead then you 
could avoid adding the duplicate function.

Best Regards,

Tim

> On 21 Jan 2019, at 05:56, Paul F Fraser via osgi-dev  
> wrote:
> 
> Using the Apache httpclient-osgi bundle 
> https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient-osgi/4.5.6
>  in a (new) enRoute project I get this error-
> 
> [ERROR] Failed to execute goal 
> biz.aQute.bnd:bnd-export-maven-plugin:4.1.0:export (default) on project 
> qQNESiteAPP:
> Unable to resolve <>: missing requirement 
> osgi.identity;filter:='(osgi.identity=net.qnenet.qnesite.qHttpClientImpl)'
> [caused by: Unable to resolve net.qnenet.qnesite.qHttpClientImpl 
> version=0.0.1.201901210415:
> missing requirement 
> osgi.wiring.package;filter:='(&(osgi.wiring.package=org.apache.http))'] -> 
> [Help 1]
> 
> Is this a similar problem to that discussed where Tim Ward stated -
> 
> "Now in fact the Felix Http Jetty implementation used in OSGi enRoute *does* 
> provide this service, however it is missing the metadata from the manifest 
> saying that it provides this service. This is a packaging bug in the Felix 
> Jetty bundle, and is why the resolve fails."
> 
> Checking the exports from the bundle, "org.apache.http" appears many times 
> but I cannot see a distinct export for that package although I could have 
> missed it.
> 
> Is there a problem with the apache httpclient for OSGi purposes?
> 
> Paul Fraser
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev