Vaadin 7.0.0 on Virgo 3.5.0

Hi and pre-thanks for any help you can offer me,

I modified the bundle created with

mvn archetype:generate \
    -DarchetypeGroupId=com.vaadin \
    -DarchetypeArtifactId=vaadin-archetype-application \
    -DarchetypeVersion=LATEST \
    -DgroupId=your.company \
    -DartifactId=project-name \
    -Dversion=1.0 \
    -Dpackaging=war

so I could deploy it to Virgo. However, once deployed the server does not serve the request for
VAADIN/themes/reindeer/styles.css
, instead replying with a 404.

My question is, how is this request meant to be handled by
VaadinServlet
? I suspect that it’s something to do with the OSGI environment such that I need to tell something to actually load the
c.v.vaadin-themes
bundle.

Here are the steps I used to get this far:

Use this servlet from
web.xml
instead of the
VaadinServlet
.

package your.company;

import javax.servlet.ServletException;

import com.vaadin.server.VaadinServlet;

public class MyVaadinServlet extends VaadinServlet {
	protected void servletInitialized() throws ServletException {
		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
		getService().setClassLoader(contextClassLoader);
	};
}

Change
MANIFEST.MF
:

Manifest-Version: 1.0
Module-Type: Web
Bundle-Version: 2.3.0
Bundle-Name: Project Name
Bundle-ManifestVersion: 2
Web-ContextPath: /project-name
Bundle-SymbolicName: your.company.project.name
Excluded-Exports: *
Bundle-ClassPath: .,WEB-INF/classes
Import-Bundle: com.vaadin.server

Add a plugin to
pom.xml
:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-war-plugin</artifactId>
	<configuration>
		<archive>
			<manifestFile>${basedir}/src/main/webapp/META-INF/MANIFEST.MF</manifestFile>
		</archive>
		<packagingExcludes>WEB-INF/classes/META-INF,WEB-INF/lib/**</packagingExcludes>
	</configuration>
</plugin>

(This one seems like a rather large bug? A
mvn package
wasn’t pulling in the
MANIFEST.MF
that the
archetype:generate
made without this change).

Many thanks,
Dan.

Hah! Of course, the previous message triggered the suspicion which turned out to be correct. Adding
com.vaadin.themes
into the
MANIFEST.MF
's
Import-Bundle
statement caused the request to be serviced correctly.

I like.
Dan.

Actually, is there any more information anyone can provide on this process? It seems like the change I made wasn’t the fix and instead it seems to be random. Some loads it returns styles.css, sometimes it doesn’t.

I managed to make this reliable by forcing the bundle to load by moving it to Virgo’s pickup directory. I like this less now, because it makes vaadin-themes an exception that will have to be catered for by our deployment toolchain.