From 562bb36b34abdc2eeb0b02eef60d5d7398e24518 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 4 Jun 2014 16:31:05 +0200 Subject: Rework plugin loading a little --- daemon/src/main/java/org/openslx/taskmanager/App.java | 3 ++- daemon/src/main/java/org/openslx/taskmanager/util/ClassLoaderHack.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/src/main/java/org/openslx/taskmanager/App.java b/daemon/src/main/java/org/openslx/taskmanager/App.java index c233229..86cae4d 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/App.java +++ b/daemon/src/main/java/org/openslx/taskmanager/App.java @@ -20,7 +20,9 @@ public class App public static void main( String[] args ) throws SocketException { + BasicConfigurator.configure(); // Load all task plugins + Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); File folder = new File( "./plugins" ); if ( !folder.exists() ) { System.out.println( "No plugin folder found - nothing to do." ); @@ -37,7 +39,6 @@ public class App System.exit( 1 ); } } - BasicConfigurator.configure(); Environment.load( "config/environment" ); NetworkHandler.init(); Taskmanager.run(); diff --git a/daemon/src/main/java/org/openslx/taskmanager/util/ClassLoaderHack.java b/daemon/src/main/java/org/openslx/taskmanager/util/ClassLoaderHack.java index 1a02ff7..0a3160c 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/util/ClassLoaderHack.java +++ b/daemon/src/main/java/org/openslx/taskmanager/util/ClassLoaderHack.java @@ -53,7 +53,7 @@ public class ClassLoaderHack { final Class clazz; try { - clazz = Class.forName( packageName + '.' + className, true, ClassLoader.getSystemClassLoader() ); + clazz = Class.forName( packageName + '.' + className ); } catch ( ClassNotFoundException e ) { return null; } -- cgit v1.2.3-55-g7522