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.