[ https://issues.apache.org/jira/browse/ARIES-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389537#comment-16389537 ]
Timothy Ward commented on ARIES-1789: ------------------------------------- This code does not seem to be using clientBuilder.newBuilder(). The exception stack trace indicates that the failing line is SSEEventSource.target(). In any event, when using the JAX-RS whiteboard a ClientBuilder must be obtained as an OSGi service from the service registry. The same is true of the SSEEventSource (which must be obtained as a factory). The specification describes this process [here|[https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134170]|https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134170].], and the SSEEventSourceFactory is documented [here title|[https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#org.osgi.service.jaxrs.client.SseEventSourceFactory].] Note that the Aries JAX-RS whiteboard does not yet support the SSE features - this work is ongoing. [~csierra] can probably tell you more. > ClientBuilder and SSE > --------------------- > > Key: ARIES-1789 > URL: https://issues.apache.org/jira/browse/ARIES-1789 > Project: Aries > Issue Type: Bug > Components: jax-rs-whiteboard > Affects Versions: jax-rs-whiteboard-1.0.0 > Reporter: Stefan Bischof > Priority: Major > > Hi, > when using: > clientBuilder.newBuilder(); > i got a > > {code:java} > java.lang.ClassNotFoundException: > org.glassfish.jersey.client.JerseyClientBuilder not found by > org.apache.aries.javax.jax.rs-api > or > java.lang.ClassNotFoundException: > org.glassfish.jersey.media.sse.internal.JerseySseEventSource$Builder not > found by org.apache.aries.javax.jax.rs-api [7] > at > javax.ws.rs.sse.SseEventSource$Builder.newBuilder(SseEventSource.java:153) > at javax.ws.rs.sse.SseEventSource.target(SseEventSource.java:238) > at de.jena.servicehub.phone.demo.DemoSseClient.test(DemoSseClient.java:38) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:136) > at > org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91) > at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) > at > org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) > at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) > at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) > at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) > at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.ClassNotFoundException: > org.glassfish.jersey.media.sse.internal.JerseySseEventSource$Builder not > found by org.apache.aries.javax.jax.rs-api [7] > at > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639{code} > > Both builders uses defaultClassNames > > {code:java} > javax.ws.rs.client.ClientBuilder > JAXRS_DEFAULT_CLIENT_BUILDER = > "org.glassfish.jersey.client.JerseyClientBuilder"; > > javax.ws.rs.sse.SseEventSource.Builder > String JAXRS_DEFAULT_SSE_BUILDER = > "org.glassfish.jersey.media.sse.internal.JerseySseEventSource$Builder"; > {code} > Both calls > javax.ws.rs.client.FactoryFinder.find(..) > and tryes to get the Object over > -ServiceLoader > -java.home/jaxrs.properties > -SystemPropertys > -Class.forName(defaultclassName); > 1. is there any was to use .newBuilder? > 2. is ther eny way to @Reference SseEventSource? > 3. is there any handling of serverside events in Aries Whiteboard or is it > necessary to register the SseFeature of(cxf/jersy) by myselfe? > -- This message was sent by Atlassian JIRA (v7.6.3#76005)