summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-02-22 10:49:27 +0200
committerIlia Motornyi <elmot@vaadin.com>2017-02-22 10:49:27 +0200
commite6eb43f9acd7fc7adbd8bc87f5b097fc2346cfe3 (patch)
treea2426d877f682a1d2d9ff033f4a7782b30ec45fc
parentfdf27c8e02fcbe0591329d5dfcfb29eee3f58759 (diff)
downloadvaadin-framework-e6eb43f9acd7fc7adbd8bc87f5b097fc2346cfe3.tar.gz
vaadin-framework-e6eb43f9acd7fc7adbd8bc87f5b097fc2346cfe3.zip
Load declarative classes using thread context class loader (#8532)
* Load declarative classes using thread context class loader Fixes #8528
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/Design.java5
2 files changed, 6 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java b/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java
index b2241f5ba5..2c014e7d47 100644
--- a/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java
+++ b/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.java
@@ -24,7 +24,7 @@ import java.security.PrivilegedAction;
* @since 7.4
* @author Vaadin Ltd
*/
-class VaadinServiceClassLoaderUtil {
+public class VaadinServiceClassLoaderUtil {
private static class GetClassLoaderPrivilegedAction
implements PrivilegedAction<ClassLoader> {
@@ -48,7 +48,7 @@ class VaadinServiceClassLoaderUtil {
* if current security policy doesn't allow acquiring current
* thread's context class loader
*/
- static protected ClassLoader findDefaultClassLoader()
+ public static ClassLoader findDefaultClassLoader()
throws SecurityException {
return AccessController.doPrivileged(
new VaadinServiceClassLoaderUtil.GetClassLoaderPrivilegedAction());
diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java
index 027fb3bc02..e0c601efbc 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/Design.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java
@@ -36,6 +36,7 @@ import org.jsoup.parser.Parser;
import org.jsoup.select.Elements;
import com.vaadin.annotations.DesignRoot;
+import com.vaadin.server.VaadinServiceClassLoaderUtil;
import com.vaadin.shared.util.SharedUtil;
import com.vaadin.ui.Component;
import com.vaadin.ui.declarative.DesignContext.ComponentCreatedEvent;
@@ -192,7 +193,9 @@ public class Design implements Serializable {
protected Class<? extends Component> resolveComponentClass(
String qualifiedClassName, DesignContext context) {
try {
- Class<?> componentClass = Class.forName(qualifiedClassName);
+ Class<?> componentClass = Class.forName(qualifiedClassName,
+ true,
+ VaadinServiceClassLoaderUtil.findDefaultClassLoader());
return componentClass.asSubclass(Component.class);
} catch (ClassNotFoundException e) {
throw new DesignException("Unable to load component for design",