From d172c32820f2323c1b5bb9c90aca9c9a2732c40a Mon Sep 17 00:00:00 2001 From: gmantele <gmantele@ari.uni-heidelberg.de> Date: Tue, 17 Feb 2015 12:33:16 +0100 Subject: [PATCH] [TAP] Fix Class loading MAJOR BUG: do not use a specific ClassLoader, but Class.forName(String). The ClassLoader is different in a WebApplication than in a standalone ; TAP.fetchClass(...) worked before in a standalone but not in a WebApplication. --- src/tap/config/TAPConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tap/config/TAPConfiguration.java b/src/tap/config/TAPConfiguration.java index 74da57e..86808ad 100644 --- a/src/tap/config/TAPConfiguration.java +++ b/src/tap/config/TAPConfiguration.java @@ -161,7 +161,7 @@ public final class TAPConfiguration { return null; try{ - Class<? extends C> classObject = (Class<? extends C>)ClassLoader.getSystemClassLoader().loadClass(classPath); + Class<? extends C> classObject = (Class<? extends C>)Class.forName(classPath); if (!expectedType.isAssignableFrom(classObject)) throw new TAPException("The class specified by the property " + propertyName + " (" + value + ") is not implementing " + expectedType.getName() + "."); else -- GitLab