title: Vaadin/OSGi : ScssStylesheet class not found
body: <p>I use vaadin and OSGi to create a modular application. After a long fight, I was able to deploy successfully the application. However, I can't load the style. When I try to access to 
  <code>http://localhost:8080/myapp/VAADIN/themes/myTheme/styles.css</code>
  I got the following exception:</p>
  
  <pre><code>exception
  
  javax.servlet.ServletException: Servlet execution threw an exception
  
  root cause
  
  java.lang.NoClassDefFoundError: com/vaadin/sass/internal/ScssStylesheet
  com.vaadin.server.VaadinServlet.serveOnTheFlyCompiledScss(VaadinServlet.java:957)
  com.vaadin.server.VaadinServlet.serveStaticResourcesInVAADIN(VaadinServlet.java:790)
  com.vaadin.server.VaadinServlet.serveStaticResources(VaadinServlet.java:760)
  com.vaadin.server.VaadinServlet.service(VaadinServlet.java:257)
  com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  
  root cause
  
  java.lang.ClassNotFoundException: com.vaadin.sass.internal.ScssStylesheet
  org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
  org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
  org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
  org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
  java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  com.vaadin.server.VaadinServlet.serveOnTheFlyCompiledScss(VaadinServlet.java:957)
  com.vaadin.server.VaadinServlet.serveStaticResourcesInVAADIN(VaadinServlet.java:790)
  com.vaadin.server.VaadinServlet.serveStaticResources(VaadinServlet.java:760)
  com.vaadin.server.VaadinServlet.service(VaadinServlet.java:257)
  com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:722)[/code]
  </code></pre>
  
  <p><code>com.vaadin.sass.internal.ScssStylesheet</code> class is offered by vaadin-theme-compiler-7.x.x.jar but the server doesn't import this package. Then, I "hacked" the vaadin server bundle by adding <code>DynamicImport-Package: *</code> in vaadin server's MANIFEST. The previous exception does not appear but I got the same for <code>org.w3c.css.sac.CSSException</code>.</p>
  
  <p>Note that by deploying the application .war file on tomcat, I had no error and the app looks like I expected (because all libraries are added under WEB-INF/lib and tomcat add them on the class loader). So, the problem is pure OSGi.</p>