Problems using vaadin 8.5.1 under OSGi

I’m trying to use Vaadin 8.5.1 under OSGi (in karaf 4.1.2 using the OPS4J whiteboard extender).

I get the error message “Failed to load the widgetset ./…/…/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js”

When I try accessing the URL
http://localhost:8181/fildele/./../../VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js?1508273514453
it is changed to
http://localhost:8181/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js?1508273514453
which returns a 404.

The karaf.log has lots of messages like these:
2017-10-17T21:56:53,203 | INFO | qtp834938474-150 | VaadinServlet | 55 - com.vaadin.server - 8.1.5 | Requested resource
[/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

Looking at the mvn:com.vaadin/vaadin-themes/8.1.5 jar file in the local maven repository, it is an OSGi bundle that contains resources with similar paths to the missing path, but not any files containing DefaultWidgetSet in their names.

Also, the MANIFEST.MF of the OSGi bundle does not export the resources:
Export-Package: com.vaadin.osgi.themes;version=“8.1.5”

(which means the resources wouldn’t have been on the OSGi classloader’s classpath even if the path had matched a resource…)

How is this expected to work?

Thanks!

Hm… it does seem like Vaadin 8.x have an active relationship with OSGi: it exposes OSGi services:

karaf@root()> bundle:list

[code]
START LEVEL 100 , List Threshold: 50
ID | State | Lvl | Version | Name
—±-------±----±---------------±--------------------------------------------------------
28 | Active | 80 | 4.1.2 | Apache Karaf :: OSGi Services :: Event
52 | Active | 80 | 8.1.5 | Default Widgetset
53 | Active | 80 | 1.2.0.vaadin1 | GenTyRef
54 | Active | 80 | 8.1.5 | Vaadin Push
55 | Active | 80 | 8.1.5 | Vaadin Server
56 | Active | 80 | 8.1.5 | Vaadin Shared
57 | Active | 80 | 8.1.5 | Vaadin Themes
62 | Active | 80 | 1.0.0.SNAPSHOT | filedele file sharing web application
99 | Active | 80 | 1.8.3 | jsoup
karaf@root()> bundle:capabilities 57
com.vaadin.themes [57]
provides:

osgi.wiring.bundle; com.vaadin.themes 8.1.5 [UNUSED]

osgi.wiring.host; com.vaadin.themes 8.1.5 [UNUSED]

osgi.identity; com.vaadin.themes 8.1.5 [UNUSED]

osgi.wiring.package; com.vaadin.osgi.themes 8.1.5 [UNUSED]

service; [javax.servlet.ServletContext]
with properties:
osgi.web.contextname = default
osgi.web.contextpath = /
osgi.web.symbolicname = com.vaadin.themes
osgi.web.version = 8.1.5
service.bundleid = 57
service.id = 152
service.scope = singleton
Used by:
org.ops4j.pax.web.pax-web-runtime [104]

karaf@root()>
[/code]But it isn’t clear to me how these services are intended to be used.