Platform:
Java 1.8
Apache Karaf 4.0.7
Pax web 4.0.3
Vaadin 7.7.4
TouchKit 4.1.0
I’m trying to use TouchKit in an OSGi webapp
https://github.com/steinarb/ukelonn/tree/using-vaadin
(NB! The TouchKit stuff hasn’t been pushed yet)
I get the error messages like the following in the log:
2017-01-02 22:11:40,615 | INFO | tp1207313930-337 | VaadinServlet | 539 - com.vaadin.server - 7.7.4 | Requested resource
[/VAADIN/themes/touchkit/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
I’ve tried debugging into the TouchKitServlet, specifically to see what it does in this code:
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo();
if (pathInfo != null) {
if (pathInfo.startsWith("/VAADIN/themes/touchkit/styles.css")) {
serveDummyFile(response, "max-age=1000000");
return;
} else if (pathInfo.startsWith("/PING")) {
serveDummyFile(response, "no-store, no-cache, max-age=0, must-revalidate");
return;
}
}
super.service(request, response);
}
There is a request with pathinfo “/themes/touchkit/styles.css” but no request with “/VAADIN/themes/touchkit/styles.css” so the serveDummyFile() method is never called.
What I’ve done that hasn’t been committed and pushed yet, is:
- Added the touchkit-agpl jar automatically changed into an OSGi bundle to the karaf runtime by adding the following to the feature file:
<bundle start-level="80">wrap:mvn:com.vaadin.addon/vaadin-touchkit-agpl/${vaadin.touchkit.version}</bundle>
- Imported the following packages into the webapp OSGi bundle
com.vaadin.addon.touchkit.server, com.vaadin.addon.touchkit.settings, com.vaadin.addon.touchkit.annotations,
- Switched the servlet mappings from the com.vaadin.server.VaadinServlet to com.vaadin.addon.touchkit.server.TouchKitServlet in the web.xml file of the webapp bundle
- Added @Theme(“touchkit”) to the UI classes
Does anyone have an idea what I might be missing?
Thanks!
- Steinar