aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/server/VaadinServletService.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/server/VaadinServletService.java')
-rw-r--r--server/src/com/vaadin/server/VaadinServletService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/VaadinServletService.java b/server/src/com/vaadin/server/VaadinServletService.java
index aaa2ce327e..7a15c0cc19 100644
--- a/server/src/com/vaadin/server/VaadinServletService.java
+++ b/server/src/com/vaadin/server/VaadinServletService.java
@@ -32,6 +32,16 @@ public class VaadinServletService extends VaadinService {
DeploymentConfiguration deploymentConfiguration) {
super(deploymentConfiguration);
this.servlet = servlet;
+
+ // Set default class loader if not already set
+ if (getClassLoader() == null) {
+ /*
+ * The servlet is most likely to be loaded with a class loader
+ * specific to the application instead of some generic system class
+ * loader that loads the Vaadin classes.
+ */
+ setClassLoader(servlet.getClass().getClassLoader());
+ }
}
protected VaadinServlet getServlet() {