Hello everyone

I am currently trying to get some better test-coverage for the websocket 
feature in Pax-Web using the Jetty websocket-client API.

Unfortunately Jetty makes use of the ServiceLoader which fails even though 
the class specified can be loaded due to different classloaders 
(Class.isAssignableFrom yields false when the classes have different 
classloaders even though the hierarchy matches).

So I came up with a naive idea to use Aries Spi-Fly which is supposed to 
handle exactly this situation and enhance Jettys websocket-client bundle 
with an additional Require-Capability header.

wrappedBundle(
 mavenBundle().groupId("org.eclipse.jetty.websocket")
 .artifactId("websocket-client")
 .version(asInProject()))
 .overwriteManifest(WrappedUrlProvisionOption.OverwriteMode.MERGE)
 .instructions(
   "Require-Capability: osgi.extender; 
filter:=\"(osgi.extender=osgi.serviceloader.registrar)\"",
   "Provide-Capability: osgi.serviceloader; 
osgi.serviceloader=javax.websocket.ContainerProvider"),


This fails during Pax-Exam initialization due to 

java.lang.IllegalStateException: Stream handler unavailable due to: null

and the reason is the url create by Pax-Url-Wrap which looks like this

wrap:mvn:org.eclipse.jetty.websocket/websocket-client/9.3.11.v20160721
$overwrite=MERGE&Require-Capability: osgi.extender; filter:=
"(osgi.extender=osgi.serviceloader.registrar)"&Provide-Capability: osgi.
serviceloader; osgi.serviceloader=javax.websocket.ContainerProvider

According to the documentation[1] this seems correct, so I thought I might 
be missing some Pax-Url-xyz bundles but after trying several I ran out of 
ideas


Am I missing something or is it just not possible what I am trying to do 
here (adding a header-entry to an existing bundle)?


regards
Marc

[1] https://ops4j1.jira.com/wiki/display/paxurl/Wrap+Protocol

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to